davmel commited on
Commit
580e226
Β·
verified Β·
1 Parent(s): 4b8857b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -19
app.py CHANGED
@@ -63,22 +63,4 @@ def predict(text):
63
  # Create the Gradio interface
64
  iface = gr.Interface(fn=predict, inputs="text", outputs="text", title="Homonym disambiguation in Georgian",
65
  description="Enter a sentence with the homonym \"αƒ‘αƒαƒ αƒ˜\" (for the current purposes, please include the homonym once in the sentence")
66
- iface.launch()
67
-
68
- exit()
69
- model = getModel()
70
- masker = {0: 'თო', 1: 'დაბ', 2: 'კაჀე'}
71
-
72
- while True:
73
- sentence = input("αƒ¨αƒ”αƒ˜αƒ§αƒ•αƒαƒœαƒ”αƒ— αƒ¬αƒ˜αƒœαƒαƒ“αƒαƒ“αƒ”αƒ‘αƒ: ")
74
- masked = getMasked(sentence)
75
- context = model(masked)[0]['token_str']
76
- print(context)
77
-
78
- if context == masker[0]:
79
- print("αƒαƒ›αƒαƒœαƒ˜αƒ›αƒ˜ αƒ’αƒαƒ›αƒαƒ§αƒ”αƒœαƒ”αƒ‘αƒ£αƒšαƒ˜αƒ, როგორαƒͺ αƒ˜αƒαƒ αƒαƒ¦αƒ˜")
80
- elif context == masker[1]:
81
- print("αƒαƒ›αƒαƒœαƒ˜αƒ›αƒ˜ αƒ’αƒαƒ›αƒαƒ§αƒ”αƒœαƒ”αƒ‘αƒ£αƒšαƒ˜αƒ, როგორαƒͺ αƒ“αƒαƒ‘αƒšαƒαƒ‘αƒ˜")
82
- else:
83
- print("αƒαƒ›αƒαƒœαƒ˜αƒ›αƒ˜ αƒ’αƒαƒ›αƒαƒ§αƒ”αƒœαƒ”αƒ‘αƒ£αƒšαƒ˜αƒ, როგორαƒͺ კაჀე")
84
- print("\n")
 
63
  # Create the Gradio interface
64
  iface = gr.Interface(fn=predict, inputs="text", outputs="text", title="Homonym disambiguation in Georgian",
65
  description="Enter a sentence with the homonym \"αƒ‘αƒαƒ αƒ˜\" (for the current purposes, please include the homonym once in the sentence")
66
+ iface.launch(share=True)