This commit is contained in:
bwt09
2022-06-06 16:28:39 -07:00
parent 7e5ab8a536
commit b1bf2e13f1
2 changed files with 9 additions and 6 deletions

View File

@@ -1,7 +1,7 @@
{
"somebody_do_something_at": {
"init_prompts": [
"<ENT0> can <ENT1> in <ENT2>."
"<ENT0> can <ENT1> in <ENT2> ."
],
"seed_ent_tuples": [
[
@@ -46,7 +46,7 @@
},
"prevent": {
"init_prompts": [
"<ENT0> prevents <ENT1>."
"<ENT0> prevents <ENT1> ."
],
"seed_ent_tuples": [
[
@@ -218,7 +218,7 @@
},
"separated_by_the_ocean": {
"init_prompts": [
"<ENT1> and <ENT0> are separated by the ocean."
"<ENT1> and <ENT0> are separated by the ocean ."
],
"seed_ent_tuples": [
[
@@ -302,7 +302,7 @@
},
"ingredient_for": {
"init_prompts": [
"<ENT0> is an ingredient for <ENT1>."
"<ENT0> is an ingredient for <ENT1> ."
],
"seed_ent_tuples": [
[
@@ -341,7 +341,7 @@
},
"release_time": {
"init_prompts": [
"<ENT0> is released in <ENT1>."
"<ENT0> is released in <ENT1> ."
],
"seed_ent_tuples": [
[
@@ -380,7 +380,7 @@
},
"processed_from": {
"init_prompts": [
"<ENT0> is the source of <ENT1>."
"<ENT0> is the source of <ENT1> ."
],
"seed_ent_tuples": [
[

View File

@@ -110,6 +110,9 @@ def main(rel_set='conceptnet', similarity_threshold=75):
relation_info = json.load(open(f'relation_info/{rel_set}.json'))
for rel, info in relation_info.items():
info['init_prompts'] = [
fix_prompt_style(prompt) for prompt in info['init_prompts']]
if 'prompts' not in info or len(info['prompts']) == 0:
info['prompts'] = search_prompts(
init_prompts=info['init_prompts'],