{"id":38335359,"url":"https://github.com/cedergrouphub/synthesis-action-retriever","last_synced_at":"2026-01-17T02:55:54.050Z","repository":{"id":78633358,"uuid":"418377260","full_name":"CederGroupHub/synthesis-action-retriever","owner":"CederGroupHub","description":"Annotated dataset and scripts for automatic retrieval of materials synthesis actions. ","archived":false,"fork":false,"pushed_at":"2024-03-18T23:22:30.000Z","size":941,"stargazers_count":4,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-09T23:38:55.290Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CederGroupHub.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2021-10-18T06:45:47.000Z","updated_at":"2023-05-05T05:07:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"671c3ffc-79b4-4dcf-83dd-f542818892f6","html_url":"https://github.com/CederGroupHub/synthesis-action-retriever","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/CederGroupHub/synthesis-action-retriever","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CederGroupHub%2Fsynthesis-action-retriever","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CederGroupHub%2Fsynthesis-action-retriever/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CederGroupHub%2Fsynthesis-action-retriever/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CederGroupHub%2Fsynthesis-action-retriever/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CederGroupHub","download_url":"https://codeload.github.com/CederGroupHub/synthesis-action-retriever/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CederGroupHub%2Fsynthesis-action-retriever/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28492591,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T02:39:23.645Z","status":"ssl_error","status_checked_at":"2026-01-17T02:34:19.649Z","response_time":85,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":"2026-01-17T02:55:53.471Z","updated_at":"2026-01-17T02:55:54.043Z","avatar_url":"https://github.com/CederGroupHub.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Synthesis Action Retrieval\n\n * classifies words tokens into following action categories:\n\n    *Starting*, *Mixing*, *Heating*, *Cooling*, *Purification*, *Shaping*, *Reaction*, *Miscellaneous*, *NotOperation*\n\n * extracts firing temperatures, times, and environment through dependency tree parsing\n \n### Installation:\n```\ngit clone https://github.com/CederGroupHub/synthesis-action-retriever.git\ncd synthesis-action-retriever\npython setup.py install\n```\n\n### Initilization:\n```\nfrom synthesis_action_retriever import SynthActionRetriever\n\nw2v_model = 'path-to-folder/models/your_word2vec_model'\nclassifier_model = 'path-to-folder/models/your_trained_classification_model'\nspacy_model = 'path-to-folder/models/your_spacy_model'\n\nSAR = SynthActionExtractor(w2v_model, classifier_model, spacy_model)\n```\n\n### Functions:\n\n_synthesis_action_retriever.py_\n\n * **get_action_labels(sentence_tokens)**:\n\n         finds actions tokens and classifies them\n\n         :param sentence: list of sentence tokens\n         :returns: list of actionss tuples (token_id, actionn_type) found in the sentence\n\n_conditions_extraction.py_\n\n * **get_times_toks(sentence_tokens)**:\n \n        finds tokens corresponding to time values\n        \n        :param sentence tokens: list of sentence tokens\n        :returns: token_id, value, unit of time\n       \n * **get_temperatures_toks(sentence_tokens)**:\n \n        finds tokens corresponding to temperature values\n        \n        :param sentence tokens: list of sentence tokens\n        :returns: token_id, value, unit of temperature\n        \n * **get_environment_toks(sentence_tokens, materials)**:\n \n        finds tokens corresponding to environment values\n        \n        :param sentence tokens: list of sentence tokens\n        :param materials: list of materials in sentence\n        :returns: token_id, value, unit of environment \n        \n_build_graph.py_\n\n * **build_graph(sentence_tokens, action_tags, materials)**:\n \n        builds synthesis workflow provided sentence tokens, action tags and materials list (optionally)\n        :param sentence_tokens: list of strings\n        :param action_tags: list of strings of same length as sentence_tokens\n        :param materials: (optional) list of {\"text\": material, \"tok_ids\": list of tok ids in sentence}\n        :return: list of dict        \n\n### Example:\n```\nimport os\nimport json\nfrom pprint import pprint\nfrom synthesis_action_retriever.synthesis_action_retriever import SynthActionRetriever\nfrom synthesis_action_retriever.build_graph import GraphBuilder\nfrom synthesis_action_retriever.utils import make_spacy_tokens\n\ndir_path = \"path-to-models\"\nw2v_model = \"path-to-w2v_model\"\next_model = \"path-to-ext_model\"\n\nsar = SynthActionRetriever(\n    embedding_model=os.path.join(dir_path, w2v_model),\n    extractor_model=os.path.join(dir_path, ext_model)\n)\ngb = GraphBuilder()\n\nwith open('./data/example_sentences.json', 'r') as fp:\n    examples = json.load(fp)\n\ngraph = []\nfor sent in examples:\n    spacy_tokens = make_spacy_tokens(sent[\"sentence\"])\n    actions = sar.get_action_labels(spacy_tokens)\n    graph.append(gb.build_graph(spacy_tokens, actions, sent[\"materials\"]))\n\nrefined_graph = gb.refine_graph(graph, examples)\npprint(refined_graph)\n```\n\n### Citation:\n\nIf you find the codes and data useful, please cite our paper:\n\n```\n@Article{D1DD00034A,\nauthor =\"Wang, Zheren and Cruse, Kevin and Fei, Yuxing and Chia, Ann and Zeng, Yan and Huo, Haoyan and He, Tanjin and Deng, Bowen and Kononova, Olga and Ceder, Gerbrand\",\ntitle  =\"ULSA: unified language of synthesis actions for the representation of inorganic synthesis protocols\",\njournal  =\"Digital Discovery\",\nyear  =\"2022\",\npages  =\"-\",\npublisher  =\"RSC\",\ndoi  =\"10.1039/D1DD00034A\",\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcedergrouphub%2Fsynthesis-action-retriever","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcedergrouphub%2Fsynthesis-action-retriever","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcedergrouphub%2Fsynthesis-action-retriever/lists"}