From de9d5206733d69450686aef08036598011f9b91f Mon Sep 17 00:00:00 2001 From: Carlos Vega <carlos.vega@uni.lu> Date: Tue, 19 Nov 2019 11:00:23 +0100 Subject: [PATCH] improved method description docstring --- interface/TextMiningService.py | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/interface/TextMiningService.py b/interface/TextMiningService.py index 39760df..b22f8ac 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 - -- GitLab