carrie commited on
Commit
ec6ca10
1 Parent(s): e4b1ff4

initial commit of app.py

Browse files
Files changed (1) hide show
  1. app.py +28 -0
app.py ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ import gradio as gr
3
+ from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
4
+
5
+
6
+ model = AutoModelForSeq2SeqLM.from_pretrained("fangyuan/lfqa_role_classification")
7
+ tokenizer = AutoTokenizer.from_pretrained("fangyuan/lfqa_role_classification")
8
+
9
+
10
+ def predict(input):
11
+ """the prediction function"""
12
+ pass
13
+
14
+
15
+ gr.Interface(
16
+ fn=predict,
17
+ inputs=gr.inputs.Textbox(lines=1, label="Input a question and its multi-sentence answer."),
18
+ outputs = [
19
+ gr.outputs.Textbox(label="Predicted functional role for each sentence"),
20
+ ],
21
+ theme="peach",
22
+ title="Analyzing discourse structure of long-form answer",
23
+ description="Input a question iwht its long-form answer to see the predicted discourse structure by our role classifier.",
24
+ examples=[
25
+ ]
26
+ ).launch(enable_queue=True)
27
+
28
+