scitail / constants.py
gabrielaltay's picture
Update constants.py
dcf5eb5
raw
history blame
No virus
1.03 kB
import json
from collections import defaultdict
from enum import Enum
from types import SimpleNamespace
from bigbio.utils.license import License
BigBioValues = SimpleNamespace(NULL="<BB_NULL_STR>")
# shamelessly compied from:
# https://github.com/huggingface/datasets/blob/master/src/datasets/utils/metadata.py
langs_json = json.load(open("languages.json", "r"))
langs_dict = {k.replace("-", "_").upper(): v for k, v in json.loads(langs_json).items()}
Lang = Enum("Lang", langs_dict)
METADATA: dict = {
"_LOCAL": bool,
"_LANGUAGES": Lang,
"_PUBMED": bool,
"_LICENSE": License,
"_DISPLAYNAME": str,
}
class Tasks(Enum):
NAMED_ENTITY_RECOGNITION = "NER"
NAMED_ENTITY_DISAMBIGUATION = "NED"
EVENT_EXTRACTION = "EE"
RELATION_EXTRACTION = "RE"
COREFERENCE_RESOLUTION = "COREF"
QUESTION_ANSWERING = "QA"
TEXTUAL_ENTAILMENT = "TE"
SEMANTIC_SIMILARITY = "STS"
PARAPHRASING = "PARA"
TRANSLATION = "TRANSL"
SUMMARIZATION = "SUM"
TEXT_CLASSIFICATION = "TXTCLASS"