Esempio n. 1
0
def transorm_data(record: Dict[str, Any]) -> Dict[str, Any]:
    transormed_record: dict = {}
    transormed_record["datasetName"] = COLLECTION_NAME
    transormed_record["datasetId"] = 11
    transormed_record["record"] = {}
    transormed_record["record"]["id"] = create_hash([record["key"]])
    transormed_record["record"]["key"] = record["key"]
    transormed_record["record"]["value"] = record["value"]

    return transormed_record
Esempio n. 2
0
def transorm_data(record: Dict[str, Any]) -> Dict[str, Any]:
    transormed_record: dict = {}
    transormed_record["datasetName"] = COLLECTION_NAME
    transormed_record["datasetId"] = COLLECTION_ID
    transormed_record["record"] = {}
    transormed_record["record"]["id"] = create_hash([record["title"]])
    transormed_record["record"]["text"] = {
        "title": record["title"],
        "body": record["body"],
    }
    transormed_record["record"]["label"] = record["label"]
    return transormed_record
Esempio n. 3
0
def transorm_data(record: Dict[str, Any]) -> Dict[str, Any]:
    transormed_record: dict = {}
    transormed_record["datasetName"] = COLLECTION_NAME
    transormed_record["datasetId"] = COLLECTION_ID
    transormed_record["record"] = {}
    transormed_record["record"]["id"] = create_hash(
        [record["text"], record["date"], record["user"]]
    )
    transormed_record["record"]["text"] = {"body": record["text"]}
    transormed_record["record"]["label"] = record["target"]
    transormed_record["record"]["metadata"] = {
        "user": record["user"],
        "date": record["date"],
    }
    return transormed_record
Esempio n. 4
0
def transorm_data(record: Dict[str, Any]) -> Dict[str, Any]:
    transormed_record: dict = {}
    transormed_record["datasetName"] = COLLECTION_NAME
    transormed_record["datasetId"] = 4
    transormed_record["record"] = {}
    transormed_record["record"]["id"] = create_hash(
        [record["content"], str(record["metadata"]["first_done_at"])]
    )
    transormed_record["record"]["text"] = {"body": record["content"]}
    transormed_record["record"]["label"] = record["annotation"]["labels"]
    transormed_record["record"]["metadata"] = {
        "first_done_at": record["metadata"]["first_done_at"],
        "last_updated_by": record["metadata"]["last_updated_by"],
    }
    return transormed_record
Esempio n. 5
0
def transorm_data(record: Dict[str, Any]) -> Dict[str, Any]:
    transormed_record: dict = {}
    transormed_record["datasetName"] = COLLECTION_NAME
    transormed_record["datasetId"] = 1
    transormed_record["record"] = {}
    transormed_record["record"]["id"] = create_hash(
        [record["title"], record["metadata"]["short_description"]])
    transormed_record["record"]["snippet"] = record["metadata"][
        "short_description"]
    transormed_record["record"]["text"] = {
        "title": record["title"],
        "body": record["body"],
    }
    transormed_record["record"]["label"] = record["metadata"]["category"]
    transormed_record["record"]["metadata"] = {
        "authors": record["metadata"]["authors"],
        "language": record["language"],
    }
    return transormed_record