Create interactive_test.py
Browse files- interactive_test.py +29 -0
interactive_test.py
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
from model import AcoliModel
|
| 3 |
+
|
| 4 |
+
def interactive_test():
|
| 5 |
+
print("Loading Acoli model...")
|
| 6 |
+
model = AcoliModel("./acoli-model")
|
| 7 |
+
|
| 8 |
+
print("\n🤖 Acoli AI Model Ready!")
|
| 9 |
+
print("Type Acoli text to test the model (type 'quit' to exit)")
|
| 10 |
+
print("-" * 50)
|
| 11 |
+
|
| 12 |
+
while True:
|
| 13 |
+
user_input = input("\n📝 Enter Acoli text: ").strip()
|
| 14 |
+
|
| 15 |
+
if user_input.lower() in ['quit', 'exit', 'q']:
|
| 16 |
+
print("Goodbye! 👋")
|
| 17 |
+
break
|
| 18 |
+
|
| 19 |
+
if not user_input:
|
| 20 |
+
continue
|
| 21 |
+
|
| 22 |
+
try:
|
| 23 |
+
prediction = model.predict(user_input)
|
| 24 |
+
print(f"🎯 Prediction: {prediction}")
|
| 25 |
+
except Exception as e:
|
| 26 |
+
print(f"❌ Error: {e}")
|
| 27 |
+
|
| 28 |
+
if __name__ == "__main__":
|
| 29 |
+
interactive_test()
|