Skip to content

Commit

Permalink
fix(bigbio): better naming & fix ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuele Garda committed Feb 8, 2024
1 parent ba833f0 commit 44d73a2
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions flair/datasets/entity_linking.py
Original file line number Diff line number Diff line change
Expand Up @@ -2217,9 +2217,9 @@ def __init__(

# TODO: Adapt this following: https://github.com/flairNLP/flair/pull/3146
class BigBioEntityLinkingCorpus(Corpus, abc.ABC):
"""This class implements an adapter to data sets implemented in the BigBio framework:
"""This class implements an adapter to data sets implemented in the BigBio framework.
https://github.com/bigscience-workshop/biomedical
See: https://github.com/bigscience-workshop/biomedical
The BigBio framework harmonizes over 120 biomedical data sets and provides a uniform
programming api to access them. This adapter allows to use all named entity recognition
Expand Down Expand Up @@ -2336,9 +2336,10 @@ def _files_to_dataset(self, paths: Union[Path, List[Path]]) -> FlairDatapointDat
return FlairDatapointDataset(all_sentences)


class BIGBIO_NCBI_DISEASE(BigBioEntityLinkingCorpus):
"""This class implents the adapter for the NCBI Disease corpus:
class BIGBIO_EL_NCBI_DISEASE(BigBioEntityLinkingCorpus):
"""This class implents the adapter for the NCBI Disease corpus.
See:
- Reference: https://www.sciencedirect.com/science/article/pii/S1532046413001974
- Link: https://www.ncbi.nlm.nih.gov/CBBresearch/Dogan/DISEASE/
"""
Expand Down Expand Up @@ -2437,9 +2438,10 @@ def _file_to_dicts(self, filepath: Path) -> Iterator[Dict[str, Any]]:
yield unified_example


class BIGBIO_BC5CDR_CHEMICAL(BigBioEntityLinkingCorpus):
"""This class implents the adapter for the BC5CDR corpus (only chemical annotations):
class BIGBIO_EL_BC5CDR_CHEMICAL(BigBioEntityLinkingCorpus):
"""This class implents the adapter for the BC5CDR corpus (only chemical annotations).
See:
- Reference: https://academic.oup.com/database/article/doi/10.1093/database/baw068/2630414
- Link: https://biocreative.bioinformatics.udel.edu/tasks/biocreative-v/track-3-cdr/
"""
Expand Down Expand Up @@ -2528,9 +2530,10 @@ def _file_to_dicts(self, filepath: Path) -> Iterator[Dict[str, Any]]:
yield data


class BIGBIO_GNORMPLUS(BigBioEntityLinkingCorpus):
"""This class implents the adapter for the GNormPlus corpus:
class BIGBIO_EL_GNORMPLUS(BigBioEntityLinkingCorpus):
"""This class implents the adapter for the GNormPlus corpus.
See:
- Reference: https://www.hindawi.com/journals/bmri/2015/918710/
- Link: https://www.ncbi.nlm.nih.gov/research/bionlp/Tools/gnormplus/
"""
Expand Down

0 comments on commit 44d73a2

Please sign in to comment.