{"id":23315178,"url":"https://github.com/baranzinilab/translator_summarization","last_synced_at":"2025-04-07T03:26:11.633Z","repository":{"id":263074768,"uuid":"889274188","full_name":"BaranziniLab/translator_summarization","owner":"BaranziniLab","description":null,"archived":false,"fork":false,"pushed_at":"2024-11-16T00:41:42.000Z","size":68,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-13T08:16:44.293Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BaranziniLab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-16T00:38:35.000Z","updated_at":"2024-11-16T00:41:45.000Z","dependencies_parsed_at":"2024-11-16T04:45:35.965Z","dependency_job_id":null,"html_url":"https://github.com/BaranziniLab/translator_summarization","commit_stats":null,"previous_names":["baranzinilab/translator_summarization"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaranziniLab%2Ftranslator_summarization","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaranziniLab%2Ftranslator_summarization/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaranziniLab%2Ftranslator_summarization/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaranziniLab%2Ftranslator_summarization/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BaranziniLab","download_url":"https://codeload.github.com/BaranziniLab/translator_summarization/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247585754,"owners_count":20962390,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-20T15:31:14.897Z","updated_at":"2025-04-07T03:26:11.607Z","avatar_url":"https://github.com/BaranziniLab.png","language":"Python","readme":"## Biomedical Translator Data Summarization API\n\nThis repository contains a Flask-based API that generates summaries of structured responses from the [Biomedical Data Translator system](https://ui.transltr.io/demo) in natural language.\n\n### Summary Endpoint\n\nAPI has the summary endpoint called **\"/summary\"**.\n\nIt currently accepts JSON structured data which holds the user \"query\" and the \"results\" which has the following structure (Eg. refer this [sample data](https://github.com/karthiksoman/ncats_llm_summarization/blob/main/sample_data/mvp1-2ad7c20f-c252-4c15-bdf2-f4e4b5e7b50c.json)):\n\n```\n{\n  \"query\": \"\u003ca question of string datatype\u003e\",\n  \"results\": [\n    {\n      \"name\": \"\u003cname of a biomedical concept\u003e\",\n      \"paths\": [\n        \"\u003cbiological path 1\u003e\",\n        \"\u003cbiological path 2\u003e\",\n        \"\u003cbiological path 3\u003e\"\n      ]\n    }\n  ]\n}\n```\n\nThe list of biological paths represents the mechanistic explanation of how that answer (i.e., the biomedical concept) relates to the query.\n\n#### Make an API call\n\n**/summary** endpoint accepts **POST** request. Here is a snippet for calling the endpoint from python:\n\n```\nimport requests\n\napi_endpoint = \"https://ncats-llm-summarization.onrender.com/summary\"\n\ndef stream_response(url, data):\n    headers = {'Content-Type': 'application/json'}\n    response = requests.post(url, json=data, headers=headers, stream=True)\n    \n    if response.status_code == 200:\n        for chunk in response.iter_content(chunk_size=1, decode_unicode=True):\n            if chunk:\n                print(chunk, end='', flush=True)\n    else:\n        print(f\"Error: {response.status_code}\")\n        print(response.text)\n\nstream_response(api_endpoint, data)\n```\n\n**Note:** 'data' is the JSON data as mentioned above\n\nRefer [demo](https://github.com/karthiksoman/ncats_llm_summarization/blob/main/demo.ipynb) notebook for more details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaranzinilab%2Ftranslator_summarization","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbaranzinilab%2Ftranslator_summarization","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaranzinilab%2Ftranslator_summarization/lists"}