Source code for capreolus.collection.cds

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 CDS(IRDCollection): """PMC collection subset used by TREC CDS 2016"""
[docs] module_name = "cds"
[docs] ird_dataset_name = "pmc/v2"
[docs] collection_type = "JsonCollection"
[docs] def doc_as_json(self, doc): content = " ".join((doc.title, doc.abstract, doc.body)) return json.dumps({"id": doc.doc_id, "contents": content})