Sean MacAvaney commited on
Commit
0f58367
1 Parent(s): 95a450b

update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -8
app.py CHANGED
@@ -3,17 +3,22 @@ from pyterrier_doc2query import Doc2Query
3
 
4
  doc2query = Doc2Query()
5
 
6
- def predict(input_df):
7
- return input_df
8
 
9
  gr.Interface(
10
  predict,
11
  inputs=gr.Dataframe(
12
- headers=["docno", "text"],
13
- datatype=["str", "str"],
14
- row_count=5,
15
- col_count=(2, "fixed"),
16
- ),
17
- outputs="dataframe",
 
 
 
 
 
18
  title="pyterrier_doc2query",
19
  ).launch()
 
3
 
4
  doc2query = Doc2Query()
5
 
6
+ def predict(input):
7
+ return doc2query(input)
8
 
9
  gr.Interface(
10
  predict,
11
  inputs=gr.Dataframe(
12
+ headers=["docno", "text"],
13
+ datatype=["str", "str"],
14
+ col_count=(2, "fixed"),
15
+ value=[['0', 'The presence of communication amid scientific minds was equally important to the success of the Manhattan Project as scientific intellect was. The only cloud hanging over the impressive achievement of the atomic researchers and engineers is what their success truly meant; hundreds of thousands of innocent lives obliterated.']],
16
+ ),
17
+ outputs=gr.Dataframe(
18
+ headers=["docno", "text", "querygen"],
19
+ datatype=["str", "str", "str"],
20
+ row_count=0,
21
+ col_count=0,
22
+ ),
23
  title="pyterrier_doc2query",
24
  ).launch()