mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-12 02:06:31 +03:00
Update docs and formatting [ci skip]
This commit is contained in:
parent
888f936a73
commit
6ca06cb62c
|
@ -327,7 +327,7 @@ sents_f = 0.0
|
||||||
ents_f = {{ (1.0 / components|length)|round(2) }}
|
ents_f = {{ (1.0 / components|length)|round(2) }}
|
||||||
ents_p = 0.0
|
ents_p = 0.0
|
||||||
ents_r = 0.0
|
ents_r = 0.0
|
||||||
{%- endif -%}
|
{%- endif %}
|
||||||
{%- if "textcat" in components %}
|
{%- if "textcat" in components %}
|
||||||
cats_score = {{ (1.0 / components|length)|round(2) }}
|
cats_score = {{ (1.0 / components|length)|round(2) }}
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
|
|
|
@ -632,6 +632,12 @@ the beginning of a multi-token entity, `I` the inside of an entity of three or
|
||||||
more tokens, and `L` the end of an entity of two or more tokens. `U` denotes a
|
more tokens, and `L` the end of an entity of two or more tokens. `U` denotes a
|
||||||
single-token entity.
|
single-token entity.
|
||||||
|
|
||||||
|
<Infobox title="Changed in v3.0" variant="warning" id="biluo_tags_from_offsets">
|
||||||
|
|
||||||
|
This method was previously available as `spacy.gold.biluo_tags_from_offsets`.
|
||||||
|
|
||||||
|
</Infobox>
|
||||||
|
|
||||||
> #### Example
|
> #### Example
|
||||||
>
|
>
|
||||||
> ```python
|
> ```python
|
||||||
|
@ -647,6 +653,7 @@ single-token entity.
|
||||||
| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||||
| `doc` | The document that the entity offsets refer to. The output tags will refer to the token boundaries within the document. ~~Doc~~ |
|
| `doc` | The document that the entity offsets refer to. The output tags will refer to the token boundaries within the document. ~~Doc~~ |
|
||||||
| `entities` | A sequence of `(start, end, label)` triples. `start` and `end` should be character-offset integers denoting the slice into the original string. ~~List[Tuple[int, int, Union[str, int]]]~~ |
|
| `entities` | A sequence of `(start, end, label)` triples. `start` and `end` should be character-offset integers denoting the slice into the original string. ~~List[Tuple[int, int, Union[str, int]]]~~ |
|
||||||
|
| `missing` | The label used for missing values, e.g. if tokenization doesn't align with the entity offsets. Defaults to `"O"`. ~~str~~ |
|
||||||
| **RETURNS** | A list of strings, describing the [BILUO](/usage/linguistic-features#accessing-ner) tags. ~~List[str]~~ |
|
| **RETURNS** | A list of strings, describing the [BILUO](/usage/linguistic-features#accessing-ner) tags. ~~List[str]~~ |
|
||||||
|
|
||||||
### training.biluo_tags_to_offsets {#biluo_tags_to_offsets tag="function"}
|
### training.biluo_tags_to_offsets {#biluo_tags_to_offsets tag="function"}
|
||||||
|
@ -654,6 +661,12 @@ single-token entity.
|
||||||
Encode per-token tags following the
|
Encode per-token tags following the
|
||||||
[BILUO scheme](/usage/linguistic-features#accessing-ner) into entity offsets.
|
[BILUO scheme](/usage/linguistic-features#accessing-ner) into entity offsets.
|
||||||
|
|
||||||
|
<Infobox title="Changed in v3.0" variant="warning" id="offsets_from_biluo_tags">
|
||||||
|
|
||||||
|
This method was previously available as `spacy.gold.offsets_from_biluo_tags`.
|
||||||
|
|
||||||
|
</Infobox>
|
||||||
|
|
||||||
> #### Example
|
> #### Example
|
||||||
>
|
>
|
||||||
> ```python
|
> ```python
|
||||||
|
@ -678,6 +691,12 @@ Encode per-token tags following the
|
||||||
[`Span`](/api/span) objects. This can be used to create entity spans from
|
[`Span`](/api/span) objects. This can be used to create entity spans from
|
||||||
token-based tags, e.g. to overwrite the `doc.ents`.
|
token-based tags, e.g. to overwrite the `doc.ents`.
|
||||||
|
|
||||||
|
<Infobox title="Changed in v3.0" variant="warning" id="spans_from_biluo_tags">
|
||||||
|
|
||||||
|
This method was previously available as `spacy.gold.spans_from_biluo_tags`.
|
||||||
|
|
||||||
|
</Infobox>
|
||||||
|
|
||||||
> #### Example
|
> #### Example
|
||||||
>
|
>
|
||||||
> ```python
|
> ```python
|
||||||
|
|
|
@ -551,17 +551,19 @@ Note that spaCy v3.0 now requires **Python 3.6+**.
|
||||||
|
|
||||||
### Removed or renamed API {#incompat-removed}
|
### Removed or renamed API {#incompat-removed}
|
||||||
|
|
||||||
| Removed | Replacement |
|
| Removed | Replacement |
|
||||||
| -------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
|
| -------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||||
| `Language.disable_pipes` | [`Language.select_pipes`](/api/language#select_pipes), [`Language.disable_pipe`](/api/language#disable_pipe) |
|
| `Language.disable_pipes` | [`Language.select_pipes`](/api/language#select_pipes), [`Language.disable_pipe`](/api/language#disable_pipe) |
|
||||||
| `GoldParse` | [`Example`](/api/example) |
|
| `Doc.is_tagged`, `Doc.is_parsed`, ... | [`Doc.has_annotation`](/api/doc#has_annotation) |
|
||||||
| `GoldCorpus` | [`Corpus`](/api/corpus) |
|
| `GoldParse` | [`Example`](/api/example) |
|
||||||
| `KnowledgeBase.load_bulk`, `KnowledgeBase.dump` | [`KnowledgeBase.from_disk`](/api/kb#from_disk), [`KnowledgeBase.to_disk`](/api/kb#to_disk) |
|
| `GoldCorpus` | [`Corpus`](/api/corpus) |
|
||||||
| `Matcher.pipe`, `PhraseMatcher.pipe` | not needed |
|
| `KnowledgeBase.load_bulk`, `KnowledgeBase.dump` | [`KnowledgeBase.from_disk`](/api/kb#from_disk), [`KnowledgeBase.to_disk`](/api/kb#to_disk) |
|
||||||
| `spacy init-model` | [`spacy init vocab`](/api/cli#init-vocab) |
|
| `Matcher.pipe`, `PhraseMatcher.pipe` | not needed |
|
||||||
| `spacy debug-data` | [`spacy debug data`](/api/cli#debug-data) |
|
| `gold.offsets_from_biluo_tags`, `gold.spans_from_biluo_tags`, `gold.biluo_tags_from_offsets` | [`training.biluo_tags_to_offsets`](/api/top-level#biluo_tags_to_offsets), [`training.biluo_tags_to_spans`](/api/top-level#biluo_tags_to_spans), [`training.offsets_to_biluo_tags`](/api/top-level#offsets_to_biluo_tags) |
|
||||||
| `spacy profile` | [`spacy debug profile`](/api/cli#debug-profile) |
|
| `spacy init-model` | [`spacy init vocab`](/api/cli#init-vocab) |
|
||||||
| `spacy link`, `util.set_data_path`, `util.get_data_path` | not needed, symlinks are deprecated |
|
| `spacy debug-data` | [`spacy debug data`](/api/cli#debug-data) |
|
||||||
|
| `spacy profile` | [`spacy debug profile`](/api/cli#debug-profile) |
|
||||||
|
| `spacy link`, `util.set_data_path`, `util.get_data_path` | not needed, symlinks are deprecated |
|
||||||
|
|
||||||
The following deprecated methods, attributes and arguments were removed in v3.0.
|
The following deprecated methods, attributes and arguments were removed in v3.0.
|
||||||
Most of them have been **deprecated for a while** and many would previously
|
Most of them have been **deprecated for a while** and many would previously
|
||||||
|
@ -971,9 +973,9 @@ python -m spacy package ./output ./packages
|
||||||
|
|
||||||
#### Data utilities and gold module {#migrating-gold}
|
#### Data utilities and gold module {#migrating-gold}
|
||||||
|
|
||||||
The `spacy.gold` module has been renamed to `spacy.training` and the conversion
|
The `spacy.gold` module has been renamed to `spacy.training` and the conversion
|
||||||
utilities now follow the naming format of `x_to_y`. This mostly
|
utilities now follow the naming format of `x_to_y`. This mostly affects
|
||||||
affects internals, but if you've been using the span offset conversion utilities
|
internals, but if you've been using the span offset conversion utilities
|
||||||
[`offsets_to_biluo_tags`](/api/top-level#offsets_to_biluo_tags),
|
[`offsets_to_biluo_tags`](/api/top-level#offsets_to_biluo_tags),
|
||||||
[`biluo_tags_to_offsets`](/api/top-level#biluo_tags_to_offsets) or
|
[`biluo_tags_to_offsets`](/api/top-level#biluo_tags_to_offsets) or
|
||||||
[`biluo_tags_to_spans`](/api/top-level#biluo_tags_to_spans), you'll have to
|
[`biluo_tags_to_spans`](/api/top-level#biluo_tags_to_spans), you'll have to
|
||||||
|
|
|
@ -20,24 +20,27 @@ export default function Infobox({
|
||||||
[classes.danger]: variant === 'danger',
|
[classes.danger]: variant === 'danger',
|
||||||
})
|
})
|
||||||
return (
|
return (
|
||||||
<aside className={infoboxClassNames} id={id}>
|
<>
|
||||||
{title && (
|
{id && <a id={id} />}
|
||||||
<h4 className={classes.title}>
|
<aside className={infoboxClassNames}>
|
||||||
{variant !== 'default' && !emoji && (
|
{title && (
|
||||||
<Icon width={18} name={variant} inline className={classes.icon} />
|
<h4 className={classes.title}>
|
||||||
)}
|
{variant !== 'default' && !emoji && (
|
||||||
<span className={classes.titleText}>
|
<Icon width={18} name={variant} inline className={classes.icon} />
|
||||||
{emoji && (
|
|
||||||
<span className={classes.emoji} aria-hidden="true">
|
|
||||||
{emoji}
|
|
||||||
</span>
|
|
||||||
)}
|
)}
|
||||||
{title}
|
<span className={classes.titleText}>
|
||||||
</span>
|
{emoji && (
|
||||||
</h4>
|
<span className={classes.emoji} aria-hidden="true">
|
||||||
)}
|
{emoji}
|
||||||
{children}
|
</span>
|
||||||
</aside>
|
)}
|
||||||
|
{title}
|
||||||
|
</span>
|
||||||
|
</h4>
|
||||||
|
)}
|
||||||
|
{children}
|
||||||
|
</aside>
|
||||||
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user