Skip to content

Commit

Permalink
Prepare arg permutation pipelines
Browse files Browse the repository at this point in the history
  • Loading branch information
Eszti committed Nov 23, 2024
1 parent 2a2c723 commit 6c40b72
Show file tree
Hide file tree
Showing 16 changed files with 231 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tuw_nlp/sem/hrg/Documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,16 @@ python steps/predict/merge.py -d $DATA_DIR -c pipeline/config/merge_100.json
```bash
# Hrg - 100
python pipeline/pipeline.py -d $DATA_DIR -c pipeline/config/pipeline_dev_100.json
# Hrg - 100 - argument permutation
python pipeline/pipeline.py -d $DATA_DIR -c pipeline/config/pipeline_dev_100_ap.json

# Hrg - 200
python pipeline/pipeline.py -d $DATA_DIR -c pipeline/config/pipeline_dev_200.json
python pipeline/pipeline.py -d $DATA_DIR -c pipeline/config/pipeline_dev_200_ap.json

# Hrg - 300
python pipeline/pipeline.py -d $DATA_DIR -c pipeline/config/pipeline_dev_300.json
python pipeline/pipeline.py -d $DATA_DIR -c pipeline/config/pipeline_dev_300_ap.json
```

### Create random predictions for comparison
Expand All @@ -99,7 +103,7 @@ python pipeline/pipeline.py -d $DATA_DIR -c pipeline/config/pipeline_dev_random.

### Evaluate the predictions

We [evaluate](steps/eval/eval.py) our system using a slightly modified version of the [scorer](steps/eval/wire_scorer.py) from the [WiRe paper](https://aclanthology.org/W19-4002/) (since lsoie triples does not necessarily have a second argument, common words are only needed for predicates and first arguments in order for two triplets to match). We present the results of [all](eval/reports/dev_all.md) our systems and a filtered table for the [top estimation](eval/reports/dev_best.md).
We [evaluate](steps/eval/eval.py) our system using a slightly modified version of the [scorer](steps/eval/wire_scorer.py) from the [WiRe paper](https://aclanthology.org/W19-4002/) (since lsoie triples does not necessarily have a second argument, common words are only needed for predicates and first arguments in order for two triplets to match). We present the results of [all](pipeline/output/eval/eval_dev_all.md) our systems and a filtered table for the [top estimation](pipeline/output/eval/eval_dev_best.md).

```bash
# Eval all
Expand Down
1 change: 1 addition & 0 deletions tuw_nlp/sem/hrg/pipeline/config/kbest_100.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"in_dir": "dev_preproc",
"out_dir": "dev_100",
"grammar_file": "hrg_100.hrg",
"arg_permutation": false,
"filters":
{
Expand Down
21 changes: 21 additions & 0 deletions tuw_nlp/sem/hrg/pipeline/config/kbest_100_ap.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"in_dir": "dev_preproc",
"out_dir": "dev_100_ap",
"grammar_file": "hrg_100.hrg",
"arg_permutation": true,
"filters":
{
"prec":
{
"pr_metric": "prec"
},
"rec":
{
"pr_metric": "rec"
},
"f1":
{
"pr_metric": "f1"
}
}
}
1 change: 1 addition & 0 deletions tuw_nlp/sem/hrg/pipeline/config/kbest_200.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"in_dir": "dev_preproc",
"out_dir": "dev_200",
"grammar_file": "hrg_200.hrg",
"arg_permutation": false,
"filters":
{
Expand Down
21 changes: 21 additions & 0 deletions tuw_nlp/sem/hrg/pipeline/config/kbest_200_ap.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"in_dir": "dev_preproc",
"out_dir": "dev_200_ap",
"grammar_file": "hrg_200.hrg",
"arg_permutation": true,
"filters":
{
"prec":
{
"pr_metric": "prec"
},
"rec":
{
"pr_metric": "rec"
},
"f1":
{
"pr_metric": "f1"
}
}
}
1 change: 1 addition & 0 deletions tuw_nlp/sem/hrg/pipeline/config/kbest_300.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"in_dir": "dev_preproc",
"out_dir": "dev_300",
"grammar_file": "hrg_300.hrg",
"arg_permutation": false,
"filters":
{
Expand Down
21 changes: 21 additions & 0 deletions tuw_nlp/sem/hrg/pipeline/config/kbest_300_ap.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"in_dir": "dev_preproc",
"out_dir": "dev_300_ap",
"grammar_file": "hrg_300.hrg",
"arg_permutation": true,
"filters":
{
"prec":
{
"pr_metric": "prec"
},
"rec":
{
"pr_metric": "rec"
},
"f1":
{
"pr_metric": "f1"
}
}
}
17 changes: 17 additions & 0 deletions tuw_nlp/sem/hrg/pipeline/config/merge_100_ap.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"in_dir": "dev_100_ap",
"k": 10,
"bolinas_chart_filters":
[
"max",
"basic",
"prec",
"rec",
"f1"
],
"postprocess":
[
"keep"
],
"out_dir": "dev_extractions"
}
17 changes: 17 additions & 0 deletions tuw_nlp/sem/hrg/pipeline/config/merge_200_ap.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"in_dir": "dev_200_ap",
"k": 10,
"bolinas_chart_filters":
[
"max",
"basic",
"prec",
"rec",
"f1"
],
"postprocess":
[
"keep"
],
"out_dir": "dev_extractions"
}
17 changes: 17 additions & 0 deletions tuw_nlp/sem/hrg/pipeline/config/merge_300_ap.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"in_dir": "dev_300_ap",
"k": 10,
"bolinas_chart_filters":
[
"max",
"basic",
"prec",
"rec",
"f1"
],
"postprocess":
[
"keep"
],
"out_dir": "dev_extractions"
}
21 changes: 21 additions & 0 deletions tuw_nlp/sem/hrg/pipeline/config/pipeline_dev_100_ap.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"last": 5,
"steps":
[
{
"step_name": "kbest",
"script_name": "kbest",
"config": "kbest_100_ap.json"
},
{
"step_name": "predict",
"script_name": "predict",
"config": "predict_100_ap.json"
},
{
"step_name": "merge",
"script_name": "merge",
"config": "merge_100_ap.json"
}
]
}
20 changes: 20 additions & 0 deletions tuw_nlp/sem/hrg/pipeline/config/pipeline_dev_200_ap.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"steps":
[
{
"step_name": "kbest",
"script_name": "kbest",
"config": "kbest_200_ap.json"
},
{
"step_name": "predict",
"script_name": "predict",
"config": "predict_200_ap.json"
},
{
"step_name": "merge",
"script_name": "merge",
"config": "merge_200_ap.json"
}
]
}
20 changes: 20 additions & 0 deletions tuw_nlp/sem/hrg/pipeline/config/pipeline_dev_300_ap.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"steps":
[
{
"step_name": "kbest",
"script_name": "kbest",
"config": "kbest_300_ap.json"
},
{
"step_name": "predict",
"script_name": "predict",
"config": "predict_300_ap.json"
},
{
"step_name": "merge",
"script_name": "merge",
"config": "merge_300_ap.json"
}
]
}
16 changes: 16 additions & 0 deletions tuw_nlp/sem/hrg/pipeline/config/predict_100_ap.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"preproc_dir": "dev_preproc",
"in_dir": "dev_100_ap",
"bolinas_chart_filters":
[
"basic",
"max",
"prec",
"rec",
"f1"
],
"postprocess":
[
"keep"
]
}
16 changes: 16 additions & 0 deletions tuw_nlp/sem/hrg/pipeline/config/predict_200_ap.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"preproc_dir": "dev_preproc",
"in_dir": "dev_200_ap",
"bolinas_chart_filters":
[
"basic",
"max",
"prec",
"rec",
"f1"
],
"postprocess":
[
"keep"
]
}
16 changes: 16 additions & 0 deletions tuw_nlp/sem/hrg/pipeline/config/predict_300_ap.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"preproc_dir": "dev_preproc",
"in_dir": "dev_300_ap",
"bolinas_chart_filters":
[
"basic",
"max",
"prec",
"rec",
"f1"
],
"postprocess":
[
"keep"
]
}

0 comments on commit 6c40b72

Please sign in to comment.