qanastek commited on
Commit
4353aed
1 Parent(s): fe3ef45
Files changed (2) hide show
  1. app.py +18 -1
  2. requirements.txt +1 -0
app.py CHANGED
@@ -1,7 +1,24 @@
1
  import gradio as gr
2
 
 
 
 
 
 
 
3
  def greet(name):
4
- return "Hello " + name + "!!"
 
 
 
 
 
 
 
 
 
 
 
5
 
6
  iface = gr.Interface(fn=greet, inputs="text", outputs="text")
7
  iface.launch()
 
1
  import gradio as gr
2
 
3
+ from flair.data import Sentence
4
+ from flair.models import SequenceTagger
5
+
6
+ # Load the model
7
+ model = SequenceTagger.load("qanastek/pos-french")
8
+
9
  def greet(name):
10
+
11
+ res = "Hello " + name + "!!"
12
+
13
+ sentence = Sentence("George Washington est allé à Washington")
14
+
15
+ # predict tags
16
+ model.predict(sentence)
17
+
18
+ # print predicted pos tags
19
+ res = sentence.to_tagged_string()
20
+
21
+ return res
22
 
23
  iface = gr.Interface(fn=greet, inputs="text", outputs="text")
24
  iface.launch()
requirements.txt CHANGED
@@ -0,0 +1 @@
 
 
1
+ flair==0.8.0.post1