Source code for capreolus.collection.covidabstract

import json

from capreolus import constants
from capreolus.utils.loginit import get_logger

from . import Collection, IRDCollection

[docs]logger = get_logger(__name__)
[docs]PACKAGE_PATH = constants["PACKAGE_PATH"]
[docs]@Collection.register class CovidAbstract(IRDCollection): """TREC-COVID with only abstracts (no title or body)"""
[docs] module_name = "covidabstract"
[docs] ird_dataset_name = "cord19/trec-covid"
[docs] collection_type = "JsonCollection"
[docs] def doc_as_json(self, doc): return json.dumps({"id": doc.doc_id, "contents": doc.abstract})