Update README.md
Browse files
README.md
CHANGED
@@ -9,6 +9,7 @@ pipeline_tag: token-classification
|
|
9 |
tags:
|
10 |
- medical
|
11 |
- biomedical
|
|
|
12 |
---
|
13 |
|
14 |
|
@@ -53,13 +54,13 @@ Please check the [documentation](https://medkit.readthedocs.io/en/latest/user_gu
|
|
53 |
from medkit.core.text import TextDocument
|
54 |
from medkit.text.ner.hf_entity_matcher import HFEntityMatcher
|
55 |
|
56 |
-
matcher = HFEntityMatcher(model="
|
57 |
test_doc = TextDocument("Elle souffre d'asthme mais n'a pas besoin d'Allegra")
|
58 |
|
59 |
# detect entities in the raw segment
|
60 |
detected_entities = matcher.run([test_doc.raw_segment])
|
61 |
msg = "|".join(f"'{entity.label}':{entity.text}" for entity in detected_entities)
|
62 |
-
print(f"Text: '{test_doc.text}'\n{msg}")
|
63 |
```
|
64 |
```
|
65 |
Text: "Elle souffre d'asthme mais n'a pas besoin d'Allegra"
|
@@ -108,7 +109,7 @@ Overall|0.7188|0.7660|0.7416
|
|
108 |
from medkit.text.metrics.ner import SeqEvalEvaluator
|
109 |
|
110 |
# load the matcher and get predicted entities by document
|
111 |
-
matcher = HFEntityMatcher(model="
|
112 |
predicted_entities = [matchers.run([doc.raw_segment]) for doc in test_documents]
|
113 |
|
114 |
# define seqeval evaluator
|
@@ -128,4 +129,4 @@ evaluator.compute(test_documents,predicted_entities=predicted_entities)
|
|
128 |
```
|
129 |
```
|
130 |
HeKA Research Team, “medkit, a Python library for a learning health system.” https://pypi.org/project/medkit-lib/ (accessed Jul. 24, 2023).
|
131 |
-
```
|
|
|
9 |
tags:
|
10 |
- medical
|
11 |
- biomedical
|
12 |
+
- medkit-lib
|
13 |
---
|
14 |
|
15 |
|
|
|
54 |
from medkit.core.text import TextDocument
|
55 |
from medkit.text.ner.hf_entity_matcher import HFEntityMatcher
|
56 |
|
57 |
+
matcher = HFEntityMatcher(model="camila-ud/DrBERT-CASM2")
|
58 |
test_doc = TextDocument("Elle souffre d'asthme mais n'a pas besoin d'Allegra")
|
59 |
|
60 |
# detect entities in the raw segment
|
61 |
detected_entities = matcher.run([test_doc.raw_segment])
|
62 |
msg = "|".join(f"'{entity.label}':{entity.text}" for entity in detected_entities)
|
63 |
+
print(f"Text: '{test_doc.text}'\n{msg}")
|
64 |
```
|
65 |
```
|
66 |
Text: "Elle souffre d'asthme mais n'a pas besoin d'Allegra"
|
|
|
109 |
from medkit.text.metrics.ner import SeqEvalEvaluator
|
110 |
|
111 |
# load the matcher and get predicted entities by document
|
112 |
+
matcher = HFEntityMatcher(model="camila-ud/DrBERT-CASM2")
|
113 |
predicted_entities = [matchers.run([doc.raw_segment]) for doc in test_documents]
|
114 |
|
115 |
# define seqeval evaluator
|
|
|
129 |
```
|
130 |
```
|
131 |
HeKA Research Team, “medkit, a Python library for a learning health system.” https://pypi.org/project/medkit-lib/ (accessed Jul. 24, 2023).
|
132 |
+
```
|