dustalov commited on
Commit
5513bbd
1 Parent(s): e7dddb6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +30 -25
app.py CHANGED
@@ -117,25 +117,26 @@ def handler(file: typing.IO[bytes], seed: int) -> pd.DataFrame:
117
  return df_result
118
 
119
 
120
- iface = gr.Interface(
121
- fn=handler,
122
- inputs=[
123
- gr.File(
124
- value='example.csv',
125
- file_types=['.tsv', '.csv'],
126
- label='Comparisons'
 
 
 
 
 
 
 
 
 
 
127
  ),
128
- gr.Number(
129
- label='Seed',
130
- precision=0
131
- )
132
- ],
133
- outputs=gr.Dataframe(
134
- headers=['item', 'score', 'rank'],
135
- label='Ranking'
136
- ),
137
- title='Pair2Rank: Turn Your Side-by-Side Comparisons into Ranking!',
138
- description='''
139
  This easy-to-use tool transforms pairwise comparisons (aka side-by-side) to a meaningful ranking of items.
140
 
141
  As an input, it expects a comma-separated (CSV) file with a header containing the following columns:
@@ -148,12 +149,16 @@ Possible values for `winner` are `left`, `right`, or `tie`.
148
  The provided example might be a good starting point.
149
 
150
  As the output, this tool provides a table with items, their estimated scores, and ranks.
151
- ''',
152
- article='''
153
- This tool implements the tie-aware ranking aggregation algorithm as described in
154
  [Efficient Computation of Rankings from Pairwise Comparisons](https://www.jmlr.org/papers/v24/22-1086.html).
155
- ''',
156
- allow_flagging='never'
157
- )
 
 
 
158
 
159
- iface.launch()
 
 
117
  return df_result
118
 
119
 
120
+ def main() -> None:
121
+ iface = gr.Interface(
122
+ fn=handler,
123
+ inputs=[
124
+ gr.File(
125
+ value='example.csv',
126
+ file_types=['.tsv', '.csv'],
127
+ label='Comparisons'
128
+ ),
129
+ gr.Number(
130
+ label='Seed',
131
+ precision=0
132
+ )
133
+ ],
134
+ outputs=gr.Dataframe(
135
+ headers=['item', 'score', 'rank'],
136
+ label='Ranking'
137
  ),
138
+ title='Pair2Rank: Turn Your Side-by-Side Comparisons into Ranking!',
139
+ description='''
 
 
 
 
 
 
 
 
 
140
  This easy-to-use tool transforms pairwise comparisons (aka side-by-side) to a meaningful ranking of items.
141
 
142
  As an input, it expects a comma-separated (CSV) file with a header containing the following columns:
 
149
  The provided example might be a good starting point.
150
 
151
  As the output, this tool provides a table with items, their estimated scores, and ranks.
152
+ ''',
153
+ article='''
154
+ This tool attempts to implement the tie-aware ranking aggregation algorithm as described in
155
  [Efficient Computation of Rankings from Pairwise Comparisons](https://www.jmlr.org/papers/v24/22-1086.html).
156
+ ''',
157
+ allow_flagging='never'
158
+ )
159
+
160
+ iface.launch()
161
+
162
 
163
+ if __name__ == '__main__':
164
+ main()