Sean MacAvaney commited on
Commit
4692c69
1 Parent(s): c0bdf6a
Files changed (1) hide show
  1. app.py +11 -7
app.py CHANGED
@@ -4,7 +4,7 @@ import pyterrier as pt
4
  pt.init()
5
  from pyterrier_gradio import Demo, MarkdownFile, interface, df2code, code2md, EX_Q
6
 
7
- retr = pt.TerrierRetrieve.from_dataset('msmarco_passage', 'terrier_stemmed')
8
 
9
  COLAB_NAME = 'pyterrier_retrieve.ipynb'
10
  COLAB_INSTALL = '''
@@ -17,13 +17,13 @@ def predict(input, _, wmodel, num_results, pipe_text):
17
  code = f'''import pandas as pd
18
  import pyterrier as pt ; pt.init()
19
 
20
- retr = pt.TerrierRetrieve.from_dataset('msmarco_passage', 'terrier_stemmed', wmodel={repr(wmodel)}, num_results={num_results})
21
  '''
22
  pipeline = retr
23
  if pipe_text:
24
- pipeline = pipeline >> pt.text.get_text(pt.get_dataset('irds:msmarco-passage'), 'text')
25
  code += f'''
26
- pipeline = retr >> pt.text.get_text(pt.get_dataset('irds:msmarco-passage'), 'text')
27
 
28
  pipeline({df2code(input)})'''
29
  else:
@@ -37,11 +37,15 @@ interface(
37
  MarkdownFile('README.md'),
38
  Demo(
39
  predict,
40
- {k: v for k, v in EX_Q.items() if k != 'antique/train'},
 
 
 
 
41
  [
42
  gr.Dropdown(
43
- choices=['msmarco-passage stemmed'],
44
- value='msmarco-passage stemmed',
45
  label='Index',
46
  interactive=False,
47
  ), gr.Dropdown(
 
4
  pt.init()
5
  from pyterrier_gradio import Demo, MarkdownFile, interface, df2code, code2md, EX_Q
6
 
7
+ retr = pt.TerrierRetrieve.from_dataset('vaswani', 'terrier_stemmed')
8
 
9
  COLAB_NAME = 'pyterrier_retrieve.ipynb'
10
  COLAB_INSTALL = '''
 
17
  code = f'''import pandas as pd
18
  import pyterrier as pt ; pt.init()
19
 
20
+ retr = pt.TerrierRetrieve.from_dataset('vaswani', 'terrier_stemmed', wmodel={repr(wmodel)}, num_results={num_results})
21
  '''
22
  pipeline = retr
23
  if pipe_text:
24
+ pipeline = pipeline >> pt.text.get_text(pt.get_dataset('irds:vaswani'), 'text')
25
  code += f'''
26
+ pipeline = retr >> pt.text.get_text(pt.get_dataset('irds:vaswani'), 'text')
27
 
28
  pipeline({df2code(input)})'''
29
  else:
 
37
  MarkdownFile('README.md'),
38
  Demo(
39
  predict,
40
+ pd.DataFrame([
41
+ ['1', 'measurement of dielectric constant of liquids by the use of microwave techniques'],
42
+ ['2', 'mathematical analysis and design details of waveguide fed microwave radiations'],
43
+ ['3', 'use of digital computers in the design of band pass filters having given phase and attenuation characteristics'],
44
+ ], columns=['qid', 'query']),
45
  [
46
  gr.Dropdown(
47
+ choices=['vaswani stemmed'],
48
+ value='vaswani stemmed',
49
  label='Index',
50
  interactive=False,
51
  ), gr.Dropdown(