{"id":18038885,"url":"https://github.com/lfoppiano/material-parsers","last_synced_at":"2025-10-16T04:50:00.058Z","repository":{"id":46073935,"uuid":"238130186","full_name":"lfoppiano/material-parsers","owner":"lfoppiano","description":"Material parsers and other tools, scripts Initially developed for Grobid Superconductor","archived":false,"fork":false,"pushed_at":"2024-02-21T18:05:30.000Z","size":72048,"stargazers_count":6,"open_issues_count":3,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-09-18T16:20:07.497Z","etag":null,"topics":["materials","physics","superconductors","text-mining"],"latest_commit_sha":null,"homepage":"","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/lfoppiano.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}},"created_at":"2020-02-04T05:25:32.000Z","updated_at":"2023-12-19T02:16:12.000Z","dependencies_parsed_at":"2023-12-15T21:17:38.911Z","dependency_job_id":"e06fcf26-abc9-4c6c-a83a-c45e80e5b2d9","html_url":"https://github.com/lfoppiano/material-parsers","commit_stats":{"total_commits":418,"total_committers":4,"mean_commits":104.5,"dds":"0.10526315789473684","last_synced_commit":"8057c827ca5fc814910a95d0f87dfd723086b162"},"previous_names":["lfoppiano/material-parsers","lfoppiano/grobid-superconductors-tools"],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lfoppiano%2Fmaterial-parsers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lfoppiano%2Fmaterial-parsers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lfoppiano%2Fmaterial-parsers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lfoppiano%2Fmaterial-parsers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lfoppiano","download_url":"https://codeload.github.com/lfoppiano/material-parsers/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222235886,"owners_count":16953366,"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":["materials","physics","superconductors","text-mining"],"created_at":"2024-10-30T14:07:38.549Z","updated_at":"2025-10-16T04:49:55.026Z","avatar_url":"https://github.com/lfoppiano.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Python CI](https://github.com/lfoppiano/grobid-superconductors-tools/actions/workflows/python-app.yml/badge.svg)](https://github.com/lfoppiano/grobid-superconductors-tools/actions/workflows/python-app.yml)\n\n# Material Parsers (and other tools)\n\nPreviously this project was released as `grobid-superconductors-tools`, born as aister project of [grobid-superconductors](https://github.com/lfoppiano/grobid-superconductors) containing a web service that interfaces with the python libraries (e.g. Spacy).\n\nThe service provides the following functionalities:\n\n- [Convert material name to formula](#convert-material-name-to-formula) (e.g. Lead -\u003e Pb, Hydrogen -\u003e H): `/convert/name/formula`\n- [Decompose formula into structured dict of elements](#decompose-formula-into-structured-dict-of-elements) (e.g. La x Fe 1-x O7-\u003e {La: x, Fe: 1-x, O: 7}):  `/convert/formula/composition`\n- Classify material in classes (from the superconductors domain) using a rule-base table (e.g. \"La Cu Fe\" -\u003e Cuprates): `/classify/formula`\n- Tc's classification (Tc, not-Tc): `/classify/tc` **for information please open an issue**\n- Relation extraction given a sentence and two entities: `/process/link` **for information please open an issue**\n- Material processing using Deep Learning models and rule-based processing `/process/material`\n\n## Usage\n\nThe service is deployed on huggingface spaces, and [can be used right away](https://lfoppiano-grobid-superconductors-tools.hf.space/version). For installing the service in your own environment see below.\n\n\n### Convert material name to formula\n\n```\ncurl --location 'https://lfoppiano-grobid-superconductors-tools.hf.space/convert/name/formula' \\\n--form 'input=\"Hydrogen\"'\n```\n\noutput:\n\n```\n{\"composition\": {\"H\": \"1\"}, \"name\": \"Hydrogen\", \"formula\": \"H\"}\n```\n\n### Decompose formula in a structured dict of elements\n\nExample:\n\n```\ncurl --location 'https://lfoppiano-grobid-superconductors-tools.hf.space/convert/formula/composition' \\\n\n--form 'input=\"CaBr2-x\"'\n```\n\noutput:\n\n```\n{\"composition\": {\"Ca\": \"1\", \"Br\": \"2-x\"}}\n```\n\n### Classify materials in classes\n\nExample:\n\n```\ncurl --location 'https://lfoppiano-grobid-superconductors-tools.hf.space/classify/formula' \\\n--form 'input=\"(Mo 0.96 Zr 0.04 ) 0.85 B x \"'\n```\n\noutput:\n\n```\n['Alloys']\n```\n\n### Process material\nThis process includes a combination of everything listed above, after passing the material sequence through a DL model \n\nExample:\n\n```\ncurl --location 'https://lfoppiano-material-parsers.hf.space/process/material' \\\n--form 'text=\"(Mo 0.96 Zr 0.04 ) 0.85 B x \"'\n```\n\noutput:\n\n```json\n[\n    {\n        \"formula\": {\n            \"rawValue\": \"(Mo 0.96 Zr 0.04 ) 0.85 B x\"\n        },\n        \"resolvedFormulas\": [\n            {\n                \"rawValue\": \"(Mo 0.96 Zr 0.04 ) 0.85 B x\",\n                \"formulaComposition\": {\n                    \"Mo\": \"0.816\",\n                    \"Zr\": \"0.034\",\n                    \"B\": \"x\"\n                }\n            }\n        ]\n    }\n]\n```\n\n## Evaluation\n\nThe model uses DeLFT's model BidLSTM_CRF.\n\nEvaluated on the 23/12/25\n\n```\n                  precision    recall  f1-score   support\n\n        \u003cdoping\u003e     0.6926    0.6377    0.6640       265\n   \u003cfabrication\u003e     0.3333    0.0909    0.1429        44\n       \u003cformula\u003e     0.8348    0.8459    0.8403      2569\n          \u003cname\u003e     0.7346    0.7935    0.7629       949\n         \u003cshape\u003e     0.9089    0.9608    0.9341       841\n     \u003csubstrate\u003e     0.5875    0.3176    0.4123       148\n         \u003cvalue\u003e     0.8844    0.8920    0.8882       463\n      \u003cvariable\u003e     0.9645    0.9710    0.9677       448\n\nall (micro avg.)     0.8321    0.8385    0.8353      5727\n```\n\n## Installing in your environment\n\n```\ndocker run -it lfoppiano/grobid-superconductors-tools:2.1\n```\n\n## References\n\nIf you use our work, and write about it, please cite [our paper](https://hal.inria.fr/hal-03776658):\n\n```bibtex\n@article{doi:10.1080/27660400.2022.2153633,\n    author = {Luca Foppiano and Pedro Baptista Castro and Pedro Ortiz Suarez and Kensei Terashima and Yoshihiko Takano and Masashi Ishii},\n    title = {Automatic extraction of materials and properties from superconductors scientific literature},\n    journal = {Science and Technology of Advanced Materials: Methods},\n    volume = {3},\n    number = {1},\n    pages = {2153633},\n    year = {2023},\n    publisher = {Taylor \u0026 Francis},\n    doi = {10.1080/27660400.2022.2153633},\n    URL = {\n    https://doi.org/10.1080/27660400.2022.2153633\n    },\n    eprint = {\n    https://doi.org/10.1080/27660400.2022.2153633\n    }\n}\n```\n\n## Overview of the repository\n\n- [Converters](material_parsers/converters) TSV to/from Grobid XML files conversion\n- [Linking](material_parsers/linking) module: A rule based python algorithm to link entities\n- [Commons libraries](material_parsers/commons): contains common code shared between the various component. The Grobid client was borrowed from [here](https://github.com/kermitt2/grobid-client-python), the tokenizer from [there](https://github.com/kermitt2/delft).\n\n## Developer's notes\n\n### Set up on Apple M1 \n\n```shell\nconda install -c apple tensorflow-deps\n```\n\n```shell\npip install -r requirements.macos.txt \n```\n\n```shell\nconda install scikit-learn=1.0.1\n```\n \nWe need to remove tensorflow, h5py, scikit-learn from the delft dependencies in setup.py\n\n```shell\npip install -e ../../delft \n```\n\n```shell\npip install -r requirements.txt \n```\n\nFinally, don't forget to install the spacy model\n\n```shell\npython -m spacy download en_core_web_sm\n```\n\n\n### Release \n\n```shall\nbump-my-version bump patch|minor|major\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flfoppiano%2Fmaterial-parsers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flfoppiano%2Fmaterial-parsers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flfoppiano%2Fmaterial-parsers/lists"}