This system extracts information from a set of annotated documents. Then, it checks whether, in a new set of text documents, the extracted annotation are present. This system works as baseline for ProfNER shared task [http://temu.bsc.es/smm4h-spanish/]. See CodaLab for evaluation: [https://competitions.codalab.org/competitions/28766]
- Extract annotations from tab-separated file and tokenize them.
- For a new file, tokenize words.
- Get the intersection between tokens in annotations and tokens in words.
- For a token in the intersection, check surroundings of every occurrence in the text, to confirm whether there is a match with any annotation.
- Repeat step 4 for every token in the intersection.
- Repeat steps 2-5 for every file in the directory.
- Gold standard: tab-separated file with the annotations. Format (contains headers):
tweet_id begin end type extraction
- Text files where codes will be predicted.
- Tab-separated file with annotations. There are two possible formats, depending on the sub-track we use. Format for sub-track a on tweet classification:
tweet_id label
Format for sub-track b on Named Entity Recognition detection and classification:
tweet_id begin end type extraction
Scripts written in Python 3.7, anaconda distribution Anaconda3-2019.07-Linux-x86_64.sh
You need to have installed python3 and its base libraries, plus:
- pandas
- os
- time
- re
- string
- unicodedata
- spacy
git clone <repo_url>
Both scripts accept the same two parameters:
- --gs_path (-gs) specifies the path to the Gold Standard file.
- --gs_path2 (-gs2) specifies the path to an additional GS file (not mandatory parameter).
- --data_path (-data) specifies the path to the text files.
- --out_path (-out) specifies the path to the output predictions file.
- --sub_track (-t) specifies the task we are using the system for. In ProfNER Track, there are 2 tasks (1 for tweet classification and 2 for NER).
$> python lookup.py -gs gold_standard.tsv -data datapath/ -out predictions.tsv -t TASK_NUMBER
Antonio Miranda (antonio.miranda@bsc.es)