Source code for capreolus.collection.highwire

import json

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

from . import Collection, IRDCollection

[docs]logger = get_logger(__name__)
[docs]@Collection.register class Highwire(IRDCollection): """Highire collection used by TREC Genomics 2006 and 2007"""
[docs] module_name = "highwire"
[docs] ird_dataset_name = "highwire"
[docs] collection_type = "JsonCollection"
[docs] def doc_as_json(self, doc): content = " ".join((span.text for span in doc.spans)) return json.dumps({"id": doc.doc_id, "contents": content})