ACCORD-NLP/CODE-ACCORD-Entities
Viewer • Updated • 862 • 89
How to use ACCORD-NLP/ner-albert-large with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("token-classification", model="ACCORD-NLP/ner-albert-large") # Load model directly
from transformers import AutoTokenizer, AutoModelForTokenClassification
tokenizer = AutoTokenizer.from_pretrained("ACCORD-NLP/ner-albert-large")
model = AutoModelForTokenClassification.from_pretrained("ACCORD-NLP/ner-albert-large")ACCORD-NLP is a Natural Language Processing (NLP) framework developed by the ACCORD project to facilitate Automated Compliance Checking (ACC) within the Architecture, Engineering, and Construction (AEC) sector. It consists of several pre-trained/fine-tuned machine learning models to perform the following information extraction tasks from regulatory text.
ner-albert-large is an ALBERT large model fine-tuned for sequence labelling/entity classification using CODE-ACCORD entities dataset.
git clone https://github.com/Accord-Project/accord-nlp.git
cd accord-nlp
pip install -r requirements.txt
pip install accord-nlp
from accord_nlp.text_classification.ner.ner_model import NERModel
model = NERModel('roberta', 'ACCORD-NLP/ner-roberta-large')
predictions, raw_outputs = model.predict(['The gradient of the passageway should not exceed five per cent.'])
print(predictions)
from accord_nlp.text_classification.relation_extraction.re_model import REModel
model = REModel('roberta', 'ACCORD-NLP/re-roberta-large')
predictions, raw_outputs = model.predict(['The <e1>gradient<\e1> of the passageway should not exceed <e2>five per cent</e2>.'])
print(predictions)
For more details, please refer to the ACCORD-NLP GitHub repository.