From 0d69a1422fa256ebe85d625c0ec24fc11429dabf Mon Sep 17 00:00:00 2001 From: Krzysztof Bojakowski Date: Wed, 8 May 2024 01:57:38 +0200 Subject: [PATCH] Skrypt pomocny do generowania zbioru treningowego --- conllu_generator.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 conllu_generator.py diff --git a/conllu_generator.py b/conllu_generator.py new file mode 100644 index 0000000..28f2d06 --- /dev/null +++ b/conllu_generator.py @@ -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("---")