Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,54 @@
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
| 3 |
+
datasets:
|
| 4 |
+
- ACCORD-NLP/CODE-ACCORD-Entities
|
| 5 |
+
language:
|
| 6 |
+
- en
|
| 7 |
---
|
| 8 |
+
|
| 9 |
+
# ACCORD-NLP
|
| 10 |
+
|
| 11 |
+
ACCORD-NLP is a Natural Language Processing (NLP) framework developed by the [ACCORD](https://accordproject.eu/) project to facilitate Automated Compliance Checking (ACC) within the Architecture, Engineering, and Construction (AEC) sector.
|
| 12 |
+
It consists of several pre-trained/fine-tuned machine learning models to perform the following information extraction tasks from regulatory text.
|
| 13 |
+
1. Entity Extraction/Classification (ner)
|
| 14 |
+
2. Relation Extraction/Classification (re)
|
| 15 |
+
|
| 16 |
+
**ner-bert-large** is a BERT large (cased) model fine-tuned for sequence labelling/entity classification using [CODE-ACCORD entities](https://huggingface.co/datasets/ACCORD-NLP/CODE-ACCORD-Entities) dataset.
|
| 17 |
+
|
| 18 |
+
## Installation
|
| 19 |
+
|
| 20 |
+
### From Source
|
| 21 |
+
```
|
| 22 |
+
git clone https://github.com/Accord-Project/accord-nlp.git
|
| 23 |
+
cd accord-nlp
|
| 24 |
+
pip install -r requirements.txt
|
| 25 |
+
```
|
| 26 |
+
|
| 27 |
+
### From pip
|
| 28 |
+
```
|
| 29 |
+
pip install accord-nlp
|
| 30 |
+
```
|
| 31 |
+
|
| 32 |
+
## Using Pre-trained Models
|
| 33 |
+
|
| 34 |
+
### Entity Extraction/Classification (ner)
|
| 35 |
+
|
| 36 |
+
```python
|
| 37 |
+
from accord_nlp.text_classification.ner.ner_model import NERModel
|
| 38 |
+
|
| 39 |
+
model = NERModel('roberta', 'ACCORD-NLP/ner-roberta-large')
|
| 40 |
+
predictions, raw_outputs = model.predict(['The gradient of the passageway should not exceed five per cent.'])
|
| 41 |
+
print(predictions)
|
| 42 |
+
```
|
| 43 |
+
|
| 44 |
+
### Relation Extraction/Classification (re)
|
| 45 |
+
|
| 46 |
+
```python
|
| 47 |
+
from accord_nlp.text_classification.relation_extraction.re_model import REModel
|
| 48 |
+
|
| 49 |
+
model = REModel('roberta', 'ACCORD-NLP/re-roberta-large')
|
| 50 |
+
predictions, raw_outputs = model.predict(['The <e1>gradient<\e1> of the passageway should not exceed <e2>five per cent</e2>.'])
|
| 51 |
+
print(predictions)
|
| 52 |
+
```
|
| 53 |
+
|
| 54 |
+
For more details, please refer to the [ACCORD-NLP](https://github.com/Accord-Project/accord-nlp) GitHub repository.
|