mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-24 17:06:29 +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_p = 0.0
|
||||
ents_r = 0.0
|
||||
{%- endif -%}
|
||||
{%- endif %}
|
||||
{%- if "textcat" in components %}
|
||||
cats_score = {{ (1.0 / components|length)|round(2) }}
|
||||
{%- 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
|
||||
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
|
||||
>
|
||||
> ```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~~ |
|
||||
| `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]~~ |
|
||||
|
||||
### training.biluo_tags_to_offsets {#biluo_tags_to_offsets tag="function"}
|
||||
|
@ -654,6 +661,12 @@ single-token entity.
|
|||
Encode per-token tags following the
|
||||
[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
|
||||
>
|
||||
> ```python
|
||||
|
@ -678,6 +691,12 @@ Encode per-token tags following the
|
|||
[`Span`](/api/span) objects. This can be used to create entity spans from
|
||||
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
|
||||
>
|
||||
> ```python
|
||||
|
|
|
@ -551,17 +551,19 @@ Note that spaCy v3.0 now requires **Python 3.6+**.
|
|||
|
||||
### Removed or renamed API {#incompat-removed}
|
||||
|
||||
| Removed | Replacement |
|
||||
| -------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
|
||||
| `Language.disable_pipes` | [`Language.select_pipes`](/api/language#select_pipes), [`Language.disable_pipe`](/api/language#disable_pipe) |
|
||||
| `GoldParse` | [`Example`](/api/example) |
|
||||
| `GoldCorpus` | [`Corpus`](/api/corpus) |
|
||||
| `KnowledgeBase.load_bulk`, `KnowledgeBase.dump` | [`KnowledgeBase.from_disk`](/api/kb#from_disk), [`KnowledgeBase.to_disk`](/api/kb#to_disk) |
|
||||
| `Matcher.pipe`, `PhraseMatcher.pipe` | not needed |
|
||||
| `spacy init-model` | [`spacy init vocab`](/api/cli#init-vocab) |
|
||||
| `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 |
|
||||
| Removed | Replacement |
|
||||
| -------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| `Language.disable_pipes` | [`Language.select_pipes`](/api/language#select_pipes), [`Language.disable_pipe`](/api/language#disable_pipe) |
|
||||
| `Doc.is_tagged`, `Doc.is_parsed`, ... | [`Doc.has_annotation`](/api/doc#has_annotation) |
|
||||
| `GoldParse` | [`Example`](/api/example) |
|
||||
| `GoldCorpus` | [`Corpus`](/api/corpus) |
|
||||
| `KnowledgeBase.load_bulk`, `KnowledgeBase.dump` | [`KnowledgeBase.from_disk`](/api/kb#from_disk), [`KnowledgeBase.to_disk`](/api/kb#to_disk) |
|
||||
| `Matcher.pipe`, `PhraseMatcher.pipe` | not needed |
|
||||
| `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 init-model` | [`spacy init vocab`](/api/cli#init-vocab) |
|
||||
| `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.
|
||||
Most of them have been **deprecated for a while** and many would previously
|
||||
|
@ -972,8 +974,8 @@ python -m spacy package ./output ./packages
|
|||
#### Data utilities and gold module {#migrating-gold}
|
||||
|
||||
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
|
||||
affects internals, but if you've been using the span offset conversion utilities
|
||||
utilities now follow the naming format of `x_to_y`. This mostly affects
|
||||
internals, but if you've been using the span offset conversion utilities
|
||||
[`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_spans`](/api/top-level#biluo_tags_to_spans), you'll have to
|
||||
|
|
|
@ -20,24 +20,27 @@ export default function Infobox({
|
|||
[classes.danger]: variant === 'danger',
|
||||
})
|
||||
return (
|
||||
<aside className={infoboxClassNames} id={id}>
|
||||
{title && (
|
||||
<h4 className={classes.title}>
|
||||
{variant !== 'default' && !emoji && (
|
||||
<Icon width={18} name={variant} inline className={classes.icon} />
|
||||
)}
|
||||
<span className={classes.titleText}>
|
||||
{emoji && (
|
||||
<span className={classes.emoji} aria-hidden="true">
|
||||
{emoji}
|
||||
</span>
|
||||
<>
|
||||
{id && <a id={id} />}
|
||||
<aside className={infoboxClassNames}>
|
||||
{title && (
|
||||
<h4 className={classes.title}>
|
||||
{variant !== 'default' && !emoji && (
|
||||
<Icon width={18} name={variant} inline className={classes.icon} />
|
||||
)}
|
||||
{title}
|
||||
</span>
|
||||
</h4>
|
||||
)}
|
||||
{children}
|
||||
</aside>
|
||||
<span className={classes.titleText}>
|
||||
{emoji && (
|
||||
<span className={classes.emoji} aria-hidden="true">
|
||||
{emoji}
|
||||
</span>
|
||||
)}
|
||||
{title}
|
||||
</span>
|
||||
</h4>
|
||||
)}
|
||||
{children}
|
||||
</aside>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user