Update README.md
Browse files
README.md
CHANGED
|
@@ -53,7 +53,8 @@ entities, relations = model.inference(
|
|
| 53 |
threshold=0.5,
|
| 54 |
adjacency_threshold=0.55,
|
| 55 |
relation_threshold=0.8,
|
| 56 |
-
return_relations=True
|
|
|
|
| 57 |
)
|
| 58 |
|
| 59 |
# Print entities
|
|
@@ -104,7 +105,8 @@ entities, relations = model.inference(
|
|
| 104 |
threshold=0.5,
|
| 105 |
relation_threshold=0.5,
|
| 106 |
batch_size=8,
|
| 107 |
-
return_relations=True
|
|
|
|
| 108 |
)
|
| 109 |
|
| 110 |
for i, (text_entities, text_relations) in enumerate(zip(entities, relations)):
|
|
@@ -122,7 +124,8 @@ entities = model.inference(
|
|
| 122 |
labels=entity_labels,
|
| 123 |
relations=[], # Empty list for relations
|
| 124 |
threshold=0.5,
|
| 125 |
-
return_relations=False # Skip relation extraction
|
|
|
|
| 126 |
)
|
| 127 |
```
|
| 128 |
|
|
@@ -141,7 +144,8 @@ entities, relations = model.inference(
|
|
| 141 |
relation_threshold=0.7, # Relation classification threshold
|
| 142 |
flat_ner=True, # Enforce non-overlapping entities
|
| 143 |
multi_label=False, # Single label per entity span
|
| 144 |
-
return_relations=True
|
|
|
|
| 145 |
)
|
| 146 |
```
|
| 147 |
|
|
|
|
| 53 |
threshold=0.5,
|
| 54 |
adjacency_threshold=0.55,
|
| 55 |
relation_threshold=0.8,
|
| 56 |
+
return_relations=True,
|
| 57 |
+
flat_ner=False
|
| 58 |
)
|
| 59 |
|
| 60 |
# Print entities
|
|
|
|
| 105 |
threshold=0.5,
|
| 106 |
relation_threshold=0.5,
|
| 107 |
batch_size=8,
|
| 108 |
+
return_relations=True,
|
| 109 |
+
flat_ner=False
|
| 110 |
)
|
| 111 |
|
| 112 |
for i, (text_entities, text_relations) in enumerate(zip(entities, relations)):
|
|
|
|
| 124 |
labels=entity_labels,
|
| 125 |
relations=[], # Empty list for relations
|
| 126 |
threshold=0.5,
|
| 127 |
+
return_relations=False, # Skip relation extraction
|
| 128 |
+
flat_ner=False
|
| 129 |
)
|
| 130 |
```
|
| 131 |
|
|
|
|
| 144 |
relation_threshold=0.7, # Relation classification threshold
|
| 145 |
flat_ner=True, # Enforce non-overlapping entities
|
| 146 |
multi_label=False, # Single label per entity span
|
| 147 |
+
return_relations=True,
|
| 148 |
+
flat_ner=False
|
| 149 |
)
|
| 150 |
```
|
| 151 |
|