kataniccc commited on
Commit
6f74060
1 Parent(s): 56cb03d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -5
app.py CHANGED
@@ -1,6 +1,8 @@
1
  import gradio as gr
2
  import pandas as pd
3
 
 
 
4
  df = pd.read_csv(path/'train.csv')
5
 
6
  df.describe(include='object')
@@ -9,12 +11,16 @@ df['input'] = 'TEXT1: ' + df.context + '; TEXT2: ' + df.target + '; ANC1: ' + df
9
 
10
  df.input.head()
11
 
12
- from datasets import Dataset,DatasetDict
13
 
14
  ds = Dataset.from_pandas(df)
15
 
16
- def greet(name):
17
- return "Hello " + name + "!!"
 
 
 
 
 
 
 
18
 
19
- iface = gr.Interface(fn=greet, inputs="text", outputs="text")
20
- iface.launch()
 
1
  import gradio as gr
2
  import pandas as pd
3
 
4
+ from datasets import Dataset,DatasetDict
5
+
6
  df = pd.read_csv(path/'train.csv')
7
 
8
  df.describe(include='object')
 
11
 
12
  df.input.head()
13
 
 
14
 
15
  ds = Dataset.from_pandas(df)
16
 
17
+ def predict_text(input_text):
18
+ prediction = classifier(input_text)
19
+ return prediction
20
+
21
+
22
+ text_input = gr.inputs.Textbox(lines=7, label="Unesite tekst")
23
+ output_text = gr.outputs.Textbox(label="Predikcija")
24
+
25
+ gr.Interface(predict_text, inputs=text_input, outputs=output_text).launch()
26