Spaces:
Sleeping
Sleeping
Update keywords_processor.py
Browse files- keywords_processor.py +7 -15
keywords_processor.py
CHANGED
|
@@ -23,18 +23,10 @@ def ngram_generator(main_text, other_texts):
|
|
| 23 |
output_text = save_keywords(keywords)
|
| 24 |
return ", ".join(keywords) if keywords else "No keywords", output_text
|
| 25 |
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
submit_button.click(
|
| 35 |
-
fn=ngram_generator,
|
| 36 |
-
inputs=[main_text_input, other_texts_input],
|
| 37 |
-
outputs=[output_keywords, output_message]
|
| 38 |
-
)
|
| 39 |
-
|
| 40 |
-
if __name__ == "__main__":
|
|
|
|
| 23 |
output_text = save_keywords(keywords)
|
| 24 |
return ", ".join(keywords) if keywords else "No keywords", output_text
|
| 25 |
|
| 26 |
+
if __name__ == "__main__":
|
| 27 |
+
import sys
|
| 28 |
+
main_text = sys.argv[1] if len(sys.argv) > 1 else ""
|
| 29 |
+
other_texts = sys.argv[2] if len(sys.argv) > 2 else ""
|
| 30 |
+
keywords, output_text = ngram_generator(main_text, other_texts)
|
| 31 |
+
print(keywords)
|
| 32 |
+
print(output_text)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|