Skip to content
This repository was archived by the owner on May 30, 2025. It is now read-only.

Commit 9c29390

Browse files
committed
Add testing info
1 parent 115af8e commit 9c29390

5 files changed

Lines changed: 47 additions & 8 deletions

File tree

Readme.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ The files and folders are organized as follows:
88
* `dev/` is an empty folder where you are expected to output your corresponding `output_*.txt` files.
99
* `example/` contains a example input and output files, with some errors purposedly included, that you can use to understand exactly how the evaluation metric works.
1010
* `submit/` contains a sample submission (actually just the `trial` data splitted accordingly).
11+
* `testing/` contains the testing files.
1112

1213
## Development evaluation
1314

@@ -35,10 +36,19 @@ python3 score.py gold/ submit/
3536

3637
This script will output a file `score.txt` in the `submit` folder that contains the calculated metrics described in the `Overall evaluation...` section of the competition rules.
3738

38-
## Notes
39+
## Training
3940

4041
The actual training data is not ready yet. Only the trial data is included in the `gold` folder now. This repository will be updated with the actual gold training files in due time.
4142

4243
You can use the trial data to see a more complex scenario than that presented in the examples, and to begin developing your ideas until the actual training data is ready.
4344

4445
**The trial data is not expected to be part of the final evaluation, just use it for your convenience now.**
46+
47+
## Testing
48+
49+
The testing data is not ready yet, but will be included in due time in the `testing` folder.
50+
This folder will contain the **test** files divided in the corresponding scenarios:
51+
52+
* `scenario1-ABC` will contain **only** `input_*.txt` files.
53+
* `scenario2-BC` will contain input files **and** the corresponding `output_A_*.txt` files.
54+
* `scenario3-C` will contain input files **and** the corresponding `output_A_*.txt` files **and also** the corresponding `output_B_*.txt` files .

score.py

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,44 @@
11
#!/usr/bin/python3
2+
# coding: utf8
23

34
import sys
45
import os
56
import random
67

7-
gold = sys.argv[1] if len(sys.argv) > 1 else 'gold'
8-
submit = sys.argv[2] if len(sys.argv) > 2 else 'submit'
98

10-
with open(os.path.join(sys.argv[2], 'scores.txt'), 'wb') as fp:
11-
for label in "abc bc c".split():
12-
for val in "f1 prec rec".split():
13-
fp.write('%s_%s:%.5f\n' % (label, val, random.uniform(0,1)))
9+
import os
10+
import sys
11+
import pprint
12+
import collections
13+
from tools import (get_span,
14+
read_input,
15+
read_phrases,
16+
read_links,
17+
read_labels,
18+
compare_phrases,
19+
compare_links,
20+
compare_labels)
21+
22+
from os.path import abspath, join, exists
23+
24+
25+
def evaluate_1(fname, gold, submit):
26+
pass
27+
28+
29+
if __name__ == '__main__':
30+
gold = sys.argv[1] if len(sys.argv) > 1 else 'gold'
31+
submit = sys.argv[2] if len(sys.argv) > 2 else 'submit'
32+
33+
for fname in os.listdir(gold):
34+
if fname.endswith('_input.txt'):
35+
scenario1 = evaluate_1(fname, gold, submit)
36+
scenario2 = evaluate_2(fname, gold, submit)
37+
scenario3 = evaluate_3(fname, gold, submit)
38+
39+
with open(os.path.join(sys.argv[2], 'scores.txt'), 'wb') as fp:
40+
for label in "abc bc c".split():
41+
for val in "f1 prec rec".split():
42+
fp.write('%s_%s:%.5f\n' % (label, val, random.uniform(0,1)))
1443

15-
fp.write('macro:%.5f\n' % random.uniform(0,1))
44+
fp.write('macro:%.5f\n' % random.uniform(0,1))

testing/scenario1-ABC/.gitkeep

Whitespace-only changes.

testing/scenario2-BC/.gitkeep

Whitespace-only changes.

testing/scenario3-C/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)