Package: material-parsers
Material Parsers (and other tools)Previously this project was released asgrobid-superconductors-tools, born as aister project ofgrobid-superconductorscontaining a web service that interfaces with the python libraries (e.g. Spacy).The service provides the following functionalities:Convert material name to formula(e.g. Lead -> Pb, Hydrogen -> H):/convert/name/formulaDecompose formula into structured dict of elements(e.g. La x Fe 1-x O7-> {La: x, Fe: 1-x, O: 7}):/convert/formula/compositionClassify material in classes (from the superconductors domain) using a rule-base table (e.g. "La Cu Fe" -> Cuprates):/classify/formulaTc's classification (Tc, not-Tc):/classify/tcfor information please open an issueRelation extraction given a sentence and two entities:/process/linkfor information please open an issueMaterial processing using Deep Learning models and rule-based processing/process/materialUsageThe service is deployed on huggingface spaces, andcan be used right away. For installing the service in your own environment see below.Convert material name to formulacurl --location 'https://lfoppiano-grobid-superconductors-tools.hf.space/convert/name/formula' \
--form 'input="Hydrogen"'output:{"composition": {"H": "1"}, "name": "Hydrogen", "formula": "H"}Decompose formula in a structured dict of elementsExample:curl --location 'https://lfoppiano-grobid-superconductors-tools.hf.space/convert/formula/composition' \

--form 'input="CaBr2-x"'output:{"composition": {"Ca": "1", "Br": "2-x"}}Classify materials in classesExample:curl --location 'https://lfoppiano-grobid-superconductors-tools.hf.space/classify/formula' \
--form 'input="(Mo 0.96 Zr 0.04 ) 0.85 B x "'output:['Alloys']Process materialThis process includes a combination of everything listed above, after passing the material sequence through a DL modelExample:curl --location 'https://lfoppiano-material-parsers.hf.space/process/material' \
--form 'text="(Mo 0.96 Zr 0.04 ) 0.85 B x "'output:[{"formula":{"rawValue":"(Mo 0.96 Zr 0.04 ) 0.85 B x"},"resolvedFormulas":[{"rawValue":"(Mo 0.96 Zr 0.04 ) 0.85 B x","formulaComposition":{"Mo":"0.816","Zr":"0.034","B":"x"}}]}]Installing in your environmentdocker run -it lfoppiano/grobid-superconductors-tools:2.1ReferencesIf you use our work, and write about it, please citeour paper:@article{doi:10.1080/27660400.2022.2153633,author={Luca Foppiano and Pedro Baptista Castro and Pedro Ortiz Suarez and Kensei Terashima and Yoshihiko Takano and Masashi Ishii},title={Automatic extraction of materials and properties from superconductors scientific literature},journal={Science and Technology of Advanced Materials: Methods},volume={3},number={1},pages={2153633},year={2023},publisher={Taylor & Francis},doi={10.1080/27660400.2022.2153633},URL={https://doi.org/10.1080/27660400.2022.2153633},eprint={https://doi.org/10.1080/27660400.2022.2153633}}Overview of the repositoryConvertersTSV to/from Grobid XML files conversionLinkingmodule: A rule based python algorithm to link entitiesCommons libraries: contains common code shared between the various component. The Grobid client was borrowed fromhere, the tokenizer fromthere.Developer's notesSet up on Apple M1condainstall-cappletensorflow-depspipinstall-rrequirements.macos.txtcondainstallscikit-learn=1.0.1We need to remove tensorflow, h5py, scikit-learn from the delft dependencies in setup.pypipinstall-e../../delftpipinstall-rrequirements.txtFinally, don't forget to install the spacy modelpython-mspacydownloaden_core_web_smReleasebump-my-version bump patch|minor|major