-
Notifications
You must be signed in to change notification settings - Fork 4
/
rouge_server.py
executable file
·52 lines (48 loc) · 1.31 KB
/
rouge_server.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import requests
def eval_rouge(project_name, exp_name, run_name, decoded, reference):
try:
requests.post('http://172.31.20.117:5001/eval/rouge/add_task', json={
'project_name': project_name,
'exp_name': exp_name,
'run_name': run_name,
'data': {
'decoded': decoded,
'reference': reference
}
}, timeout=10)
except Exception as e:
print(e)
if __name__ == '__main__':
eval_rouge('test', 'legal_debugging', '444', [
[
'das dsfs sfs fds sf sd',
'das dsfs sfs fds sf sd',
'das dsfs sfs fds sf sd',
],
[
'das dsfs sfs fds sf sd',
'das dsfs sfs fds sf sd',
'das dsfs sfs fds sf sd',
],
[
'das dsfs sfs fds sf sd',
'das dsfs sfs fds sf sd',
'das dsfs sfs fds sf sd',
],
], [
[
'das dsfs sfs fds sf sd',
'das dsds sfs fds sf sd',
'das dsfs sfs fd sf sd'
],
[
'das dsfs sfs fds sf sd',
'das dsfs sfs ffs sf sd',
'das dffs sfs fds sf sd',
],
[
'das dsfs sfs fds sf sd',
'das dsfs sfs ffs sf sd',
'das dfs sfs dds sf sd',
],
])