Skip to content
Snippets Groups Projects
Commit 901b4ab2 authored by Franck Dary's avatar Franck Dary
Browse files

Made the transitionsSet generation script to output expected state name

parent c3171319
No related branches found
No related tags found
No related merge requests found
......@@ -36,6 +36,7 @@ columns: all_no_test.conllu $(MCD)
cat all_no_test.conllu | sed '/^#/ d' | cut -f$$number | sort --unique > col_$$number.txt ; \
done
./getTransitionSets.py $(MCD) col_*\.txt
cat tagger.ts parser.ts > taggerparser.ts
texts:
./getRawText.py $(CONLL2TXT) $(TRAIN_FILES) $(DEV_FILEs) $(TEST_FILES)
......
......@@ -31,7 +31,7 @@ if __name__ == "__main__" :
striped = line.strip()
if len(striped) == 0 :
continue
print("WRITE b.0 UPOS " + striped, file=output)
print("<tagger> WRITE b.0 UPOS " + striped, file=output)
output.close()
elif nameCol == "XPOS" :
......@@ -90,7 +90,7 @@ if __name__ == "__main__" :
print("SHIFT", file=output)
output.close()
output = open("parser.ts", 'w', encoding='utf-8')
print("REDUCE", file=output)
print("<parser> REDUCE", file=output)
labels = set()
labelsList = []
for line in open(colFile, "r", encoding='utf-8') :
......@@ -103,8 +103,9 @@ if __name__ == "__main__" :
labelsList.append(striped)
labelsList.sort()
for label in labelsList :
print("LEFT " + label, file=output)
print("RIGHT " + label, file=output)
print("SHIFT", file=output)
print("<parser> LEFT " + label, file=output)
print("<parser> RIGHT " + label, file=output)
print("<parser> EOS", file=output)
print("<parser> SHIFT", file=output)
output.close()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment