diff --git a/interface/TextMiningService.py b/interface/TextMiningService.py index 39760df204309a4c7e7c5e0c85209803d36979f9..b22f8acf753b79c94dfb64efcbd0cce0bfc908f0 100644 --- a/interface/TextMiningService.py +++ b/interface/TextMiningService.py @@ -1,6 +1,7 @@ from abc import ABCMeta, abstractmethod from typing import List + class Publication(): def __init__(self, pmc_id, pm_id, doi, preprint_id, other_id): self.pmc_id = pmc_id @@ -11,15 +12,23 @@ class Publication(): class TextMiningService(metaclass=ABCMeta): - + def __init__(self, name: str, description: str): self.name = name self.description = description - + @abstractmethod - def getMentions(self, entities: List) -> List[Publication]: - """ - Mentions at publication level + def getMentions(self, entities: List[str], limit: int = 20) -> List[Publication]: + """Returs a list of publications for a given list of entity IDs in which the entities appear. + + Arguments: + entities {List[str]} -- [description] + + Keyword Arguments: + limit {int} -- [description] (default: {20}) + + Returns: + List[Publication] -- [description] """ pass @@ -31,4 +40,3 @@ class TextMiningService(metaclass=ABCMeta): To-do: decide how to handle resources that can provide co-occurrences at sentence level """ pass -