|
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>") |
|
|
|
|
|
|
|
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" |