Skrypt pomocny do generowania zbioru treningowego
This commit is contained in:
parent
f5dcaf9780
commit
0d69a1422f
15
conllu_generator.py
Normal file
15
conllu_generator.py
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
print("Script to automatically append data to data/dialog.conllu")
|
||||||
|
print("Start typing now. Press Ctrl+C to stop.")
|
||||||
|
|
||||||
|
while True:
|
||||||
|
with open("data/train_dialog.conllu", "a") as f:
|
||||||
|
text = input("Text: ")
|
||||||
|
act = input("Intent: ")
|
||||||
|
slots = text.split(" ")
|
||||||
|
f.write(
|
||||||
|
f"\n# text: {text}\n# intent: {act}\n# slots:\n"
|
||||||
|
)
|
||||||
|
for i, slot in enumerate(slots):
|
||||||
|
label = input(f"{i}/{slot} label: ")
|
||||||
|
f.write(f"{i+1}\t{slot}\t{act}\t{label}\n")
|
||||||
|
print("---")
|
Loading…
Reference in New Issue
Block a user