forked from andre-martins/TurboParser
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ENH: Added scripts to create the data for reproducing the SemEval 201…
…4 paper.
- Loading branch information
1 parent
2499854
commit f6a7340
Showing
9 changed files
with
68,197 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
model_type=af+as+cs+gp+cp+ccp | ||
open=false | ||
|
||
formalism=dm | ||
C=0.01 | ||
cost_fp=0.3 | ||
cost_fn=0.7 | ||
echo "${C} ${cost_fp} ${cost_fn} ${formalism} ${model_type} ${open}" | ||
./train_test_semantic_parser.sh english ${C} ${cost_fp} ${cost_fn} ${model_type} ${open} ${formalism} >& out_open-${open}_deterministic_${formalism}_${C}_${cost_fp}_${cost_fn}_${model_type} | ||
|
||
formalism=pas | ||
C=0.01 | ||
cost_fp=0.4 | ||
cost_fn=0.6 | ||
echo "${C} ${cost_fp} ${cost_fn} ${formalism} ${model_type} ${open}" | ||
./train_test_semantic_parser.sh english ${C} ${cost_fp} ${cost_fn} ${model_type} ${open} ${formalism} >& out_open-${open}_deterministic_${formalism}_${C}_${cost_fp}_${cost_fn}_${model_type} | ||
|
||
formalism=pcedt | ||
C=0.01 | ||
cost_fp=0.3 | ||
cost_fn=0.7 | ||
echo "${C} ${cost_fp} ${cost_fn} ${formalism} ${model_type} ${open}" | ||
./train_test_semantic_parser.sh english ${C} ${cost_fp} ${cost_fn} ${model_type} ${open} ${formalism} >& out_open-${open}_deterministic_${formalism}_${C}_${cost_fp}_${cost_fn}_${model_type} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
model_type=af+as+cs+cp+ccp #af+as+cs+gp+cp+ccp | ||
open=true #false | ||
|
||
formalism=dm | ||
C=0.01 | ||
cost_fp=0.4 | ||
cost_fn=0.6 | ||
echo "${C} ${cost_fp} ${cost_fn} ${formalism} ${model_type} ${open}" | ||
./train_test_semantic_parser.sh english ${C} ${cost_fp} ${cost_fn} ${model_type} ${open} ${formalism} >& out_open-${open}_deterministic_${formalism}_${C}_${cost_fp}_${cost_fn}_${model_type} | ||
|
||
formalism=pas | ||
C=0.01 | ||
cost_fp=0.4 | ||
cost_fn=0.6 | ||
echo "${C} ${cost_fp} ${cost_fn} ${formalism} ${model_type} ${open}" | ||
./train_test_semantic_parser.sh english ${C} ${cost_fp} ${cost_fn} ${model_type} ${open} ${formalism} >& out_open-${open}_deterministic_${formalism}_${C}_${cost_fp}_${cost_fn}_${model_type} | ||
|
||
formalism=pcedt | ||
C=0.01 | ||
cost_fp=0.4 | ||
cost_fn=0.6 | ||
echo "${C} ${cost_fp} ${cost_fn} ${formalism} ${model_type} ${open}" | ||
./train_test_semantic_parser.sh english ${C} ${cost_fp} ${cost_fn} ${model_type} ${open} ${formalism} >& out_open-${open}_deterministic_${formalism}_${C}_${cost_fp}_${cost_fn}_${model_type} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import sys | ||
|
||
keep_document_names = True | ||
|
||
filepath = sys.argv[1] | ||
filepath_companion = sys.argv[2] | ||
f = open(filepath) | ||
f_companion = open(filepath_companion) | ||
for line, line_companion in zip(f, f_companion): | ||
line = line.rstrip('\n') | ||
line_companion = line_companion.rstrip('\n') | ||
if line.startswith('#') and line.split('\t')[0] != '#': | ||
if keep_document_names: print line | ||
elif line == '': | ||
print line | ||
else: | ||
fields = line.split("\t") | ||
fields_companion = line_companion.split("\t") | ||
word_index = fields[0] | ||
word = fields[1] | ||
lemma = fields[2] | ||
pos = fields[3] | ||
if len(fields) == 4: | ||
top = '-' | ||
pred = '-' | ||
else: | ||
top = fields[4] | ||
pred = fields[5] | ||
args = fields[6:] | ||
predicted_pos = fields_companion[0] | ||
head = fields_companion[1] | ||
deprel = fields_companion[2] | ||
|
||
fields_output = [word_index, | ||
word, | ||
lemma, | ||
pos, #predicted_pos | ||
head, | ||
deprel, | ||
top, | ||
pred] | ||
fields_output.extend(args); | ||
line_output = '\t'.join(fields_output) | ||
print line_output | ||
|
||
f.close() | ||
f_companion.close() |
Oops, something went wrong.