File size: 1,032 Bytes
7f96b41 dcf5eb5 7f96b41 dcf5eb5 7f96b41 dcf5eb5 |
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 |
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" |