https://github.com/cedergrouphub/materialamountextractor
https://github.com/cedergrouphub/materialamountextractor
Last synced: 6 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/cedergrouphub/materialamountextractor
- Owner: CederGroupHub
- Created: 2019-07-20T17:25:46.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2024-03-13T21:44:24.000Z (over 2 years ago)
- Last Synced: 2025-09-09T23:38:55.027Z (10 months ago)
- Language: Python
- Size: 50.4 MB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# MaterialAmountExtractor
Extract mateirals' amounts from text.
Install
~~~~
If Git Large File Storage (lfs) is not installed on your computer, please install it fistly following the instruction on
https://help.github.com/articles/installing-git-large-file-storage/.
Then
git clone git@github.com:CederGroupHub/MaterialAmountExtractor.git
cd MaterialAMountExtractor
pip install -e .
~~~~
Use:
~~~~
input: sentence and materials in the sentence
output: materials with their amounts as dict
~~~~
Example:
~~~~
from MaterialAmountExtractor import get_materials_amounts
sentence = "In a typical synthesis of stacked SnS2 nanoplates, 0.35 g of tin tetrachloride pentahydrate (SnCl4·H2O) and 0.4 g of thiourea (Tu) were first dissolved into 25 mL of distilled water under mild stirring."
materials_in_sentence = ["tin tetrachloride pentahydrate","SnCl4·H2O","thiourea","Tu","water"]
m_m = get_materials_amounts.GetMaterialsAmounts(sentence, materials_in_sentence)
print(m_m.final_result())
## output:
## {'tin tetrachloride pentahydrate': ['0.35', 'g'], 'thiourea': ['0.4', 'g'], 'water': ['25', 'mL']}