mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-26 18:06:29 +03:00
small edits
This commit is contained in:
parent
a664994a81
commit
e95d9caa87
|
@ -855,9 +855,9 @@ def score(self, examples: Iterable[Example]) -> Dict[str, Any]:
|
||||||
...
|
...
|
||||||
|
|
||||||
return {
|
return {
|
||||||
f"rel_micro_p": prf.precision,
|
"rel_micro_p": prf.precision,
|
||||||
f"rel_micro_r": prf.recall,
|
"rel_micro_r": prf.recall,
|
||||||
f"rel_micro_f": prf.fscore,
|
"rel_micro_f": prf.fscore,
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -886,6 +886,11 @@ assigns it a name and lets you create the component with
|
||||||
> [components.relation_extractor.model.get_candidates]
|
> [components.relation_extractor.model.get_candidates]
|
||||||
> @misc = "rel_cand_generator.v1"
|
> @misc = "rel_cand_generator.v1"
|
||||||
> max_length = 20
|
> max_length = 20
|
||||||
|
>
|
||||||
|
> [training.score_weights]
|
||||||
|
> rel_micro_p: 0.0
|
||||||
|
> rel_micro_r: 0.0
|
||||||
|
> rel_micro_f: 1.0
|
||||||
> ```
|
> ```
|
||||||
|
|
||||||
```python
|
```python
|
||||||
|
@ -904,14 +909,11 @@ it produces, and the scores that can be calculated:
|
||||||
> #### config.cfg (excerpt)
|
> #### config.cfg (excerpt)
|
||||||
>
|
>
|
||||||
> ```ini
|
> ```ini
|
||||||
> [training.score_weights]
|
|
||||||
> rel_micro_p: 0.0
|
|
||||||
> rel_micro_r: 0.0
|
|
||||||
> rel_micro_f: 1.0
|
|
||||||
> ```
|
> ```
|
||||||
|
|
||||||
```python
|
```python
|
||||||
### Factory annotations
|
### Factory annotations {highlight="5-11"}
|
||||||
from spacy.language import Language
|
from spacy.language import Language
|
||||||
|
|
||||||
@Language.factory(
|
@Language.factory(
|
||||||
|
|
Loading…
Reference in New Issue
Block a user