From cdec42d6d712d54df259b99ab65c2f3f5362bc2b Mon Sep 17 00:00:00 2001 From: Carlos Vega <carlos.vega@uni.lu> Date: Tue, 19 Nov 2019 15:09:13 +0100 Subject: [PATCH] added get_co_occurrences to the dummy class --- dummy-service/dummyService.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dummy-service/dummyService.py b/dummy-service/dummyService.py index e29c494..6a9c16d 100644 --- a/dummy-service/dummyService.py +++ b/dummy-service/dummyService.py @@ -17,7 +17,7 @@ class DummyService(TextMiningService): def get_co_occurrences(self, entity: str, limit: int = 20, types: List[str] = None) -> List[CoOccurrence]: values = [] for idx in range(limit): - entity_code = str(idx) + entity_code = f'{entity}_{idx}' count = int(idx*idx) co_occur = CoOccurrence(entity_code, count) values.append(co_occur) @@ -29,3 +29,5 @@ if __name__ == '__main__': print("Using service {}".format(text_mining_service.name)) publications = text_mining_service.get_mentions(["DOID:0000"]) print(", ".join([p.pm_id for p in publications])) + cooccurrences = text_mining_service.get_co_occurrences('DOID:0000') + print(cooccurrences) -- GitLab