Commit Graph

9365 Commits

Author SHA1 Message Date
Raphael Mitsch
4a921766f1 Remove prior_prob from supported properties in Candidate. Introduce KnowledgeBase.supports_prior_probs(). 2023-03-13 16:54:38 +01:00
Raphael Mitsch
6adc15178f Partially fix alias/mention terminology usage. Convert Candidate to interface. 2023-03-13 14:26:14 +01:00
Raphael Mitsch
649c146e2c Move attributes out of Candidate. 2023-03-13 09:21:08 +01:00
Raphael Mitsch
ce23942320 Merge branch 'refactor/el-candidates' of github.com:rmitsch/spaCy into refactor/el-candidates 2023-03-10 09:04:10 +01:00
Raphael Mitsch
348dd1c87e Update docstrings. 2023-03-10 09:03:41 +01:00
Raphael Mitsch
27053912da Drop unused InMemoryCandidate._entity_hash. 2023-03-10 09:00:30 +01:00
Raphael Mitsch
6fc7997c06 Fix entity_id refactoring problems in docstrings. 2023-03-10 08:55:32 +01:00
Raphael Mitsch
34e092e4e5
Update spacy/kb/candidate.pxd
Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com>
2023-03-09 16:15:39 +01:00
Raphael Mitsch
c61654eef8 Drop storing mention. 2023-03-09 15:04:10 +01:00
Raphael Mitsch
b0ee34185d Add abstract class check. 2023-03-09 14:56:44 +01:00
Raphael Mitsch
b476041417 Port Candidate and InMemoryCandidate to Cython. 2023-03-09 14:44:41 +01:00
Raphael Mitsch
1c937db3af Rename 'alias' to 'mention'. 2023-03-09 12:06:15 +01:00
Raphael Mitsch
cea58ade89 Simplify interface for int/str representations. 2023-03-07 14:35:38 +01:00
Raphael Mitsch
0c63940407 Merge branch 'v4' into refactor/el-candidates
# Conflicts:
#	spacy/errors.py
2023-03-07 14:00:23 +01:00
Raphael Mitsch
f8a02f7fef Updated error code. 2023-03-07 13:58:42 +01:00
Raphael Mitsch
082992aebb
Update spacy/kb/candidate.py
Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com>
2023-03-07 13:54:11 +01:00
Raphael Mitsch
41b3a0d932
Drop support for EntityLinker_v1. (#12377) 2023-03-07 13:10:45 +01:00
Raphael Mitsch
8dbb74c9c0 Merge branch 'v4' into refactor/el-candidates 2023-03-07 09:06:51 +01:00
Raphael Mitsch
749e446ee3 Merge branch 'master' into sync/master-into-v4
# Conflicts:
#	.github/azure-steps.yml
2023-03-06 16:27:56 +01:00
Adriane Boyd
0bbc620dd8
Partially work around pending deprecation of pkg_resources (#12368)
* Handle deprecation of pkg_resources

* Replace `pkg_resources` with `importlib_metadata` for `spacy info
--url`
* Remove requirements check from `spacy project` given the lack of
alternatives

* Fix installed model URL method and CI test

* Fix types/handling, simplify catch-all return

* Move imports instead of disabling requirements check

* Format

* Reenable test with ignored deprecation warning

* Fix except

* Fix return
2023-03-06 14:48:57 +01:00
Raphael Mitsch
2ac586fdb5 Update error code in line with v4 convention. 2023-03-05 14:43:32 +01:00
Raphael Mitsch
670e1ca7c5 Fix mypy error. 2023-03-05 14:33:32 +01:00
Raphael Mitsch
5f40b3e523 Format. 2023-03-05 14:14:16 +01:00
Raphael Mitsch
38dce966e5 Refacor Candidate attributes and their usage. 2023-03-05 13:49:13 +01:00
Raphael Mitsch
94e57d0ed5 Refactor Candidate attribute names. Update docs and tests accordingly. 2023-03-03 11:08:17 +01:00
Raphael Mitsch
46fe069f87 Rename alias -> mention. 2023-03-03 10:29:53 +01:00
Raphael Mitsch
1ea31552be Merge branch 'master' into sync/master-into-v4
# Conflicts:
#	requirements.txt
#	spacy/pipeline/entity_linker.py
#	spacy/util.py
#	website/docs/api/entitylinker.mdx
2023-03-02 16:24:15 +01:00
Raphael Mitsch
6aa6b86d49
Make generation of empty KnowledgeBase instances configurable in EntityLinker (#12320)
* Make empty_kb() configurable.

* Format.

* Update docs.

* Be more specific in KB serialization test.

* Update KB serialization tests. Update docs.

* Remove doc update for batched candidate generation.

* Fix serialization of subclassed KB in tests.

* Format.

* Update docstring.

* Update docstring.

* Switch from pickle to json for custom field serialization.
2023-03-01 16:02:55 +01:00
Adriane Boyd
da75896ef5
Return Tuple[Span] for all Doc/Span attrs that provide spans (#12288)
* Return Tuple[Span] for all Doc/Span attrs that provide spans

* Update Span types
2023-03-01 16:00:02 +01:00
Raphael Mitsch
9bd498cdae Fix docstring and docs. 2023-03-01 15:09:24 +01:00
Raphael Mitsch
257bca3959 Format. 2023-03-01 14:54:03 +01:00
Raphael Mitsch
fa390618c8 Adjust Candidate to support and mandate numerical entity IDs. 2023-03-01 14:50:58 +01:00
Raphael Mitsch
49abf4fb3a Rename Candidate to InMemoryCandidate, BaseCandidate to Candidate. 2023-03-01 14:27:50 +01:00
Raphael Mitsch
417e8fea8b
Update spacy/kb/candidate.py
Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com>
2023-03-01 13:51:33 +01:00
Raphael Mitsch
21fa22de08 Merge branch 'refactor/el-candidates' of github.com:rmitsch/spaCy into refactor/el-candidates 2023-03-01 13:48:46 +01:00
Raphael Mitsch
3da0712582 Update doc string of BaseCandidate.__init__(). 2023-03-01 13:15:38 +01:00
Raphael Mitsch
0680958476
Update spacy/kb/candidate.py
Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com>
2023-03-01 12:42:08 +01:00
Sofie Van Landeghem
74cae47bf6
rely on is_empty property instead of __len__ (#12347) 2023-03-01 12:06:07 +01:00
Adriane Boyd
8f058e39bd
Fix error message for displacy auto_select_port (#12343) 2023-02-28 16:36:03 +01:00
TAN Long
071667376a
Add new REL_OPs: >+, >-, <+, and <- (#12334)
* Add immediate left/right child/parent dependency relations

* Add tests for new REL_OPs: `>+`, `>-`, `<+`, and `<-`.

---------

Co-authored-by: Tan Long <tanloong@foxmail.com>
2023-02-28 14:36:33 +01:00
Raphael Mitsch
a97ef65b33 Fix .entity_ typo in _add_activations() usage. 2023-02-28 14:22:27 +01:00
Raphael Mitsch
5a9d8ba73c Format. 2023-02-28 13:56:13 +01:00
Raphael Mitsch
cd98ab4e95 Convert Candidate from Cython to Python class. 2023-02-28 13:49:52 +01:00
lise-brinck
e2de188cf1
Bugfix/swedish tokenizer (#12315)
* add unittest for explosion#12311

* create punctuation.py for swedish

* removed : from infixes in swedish punctuation.py

* allow : as infix if succeeding char is uppercase
2023-02-27 10:53:45 +01:00
Kevin Humphreys
acdd993071
Matcher performance fix for extension predicates: use shared key function (#12272)
* standardize predicate key format

* single key function

* Make optional args in key function keyword-only

---------

Co-authored-by: Adriane Boyd <adrianeboyd@gmail.com>
2023-02-27 08:35:08 +01:00
Adriane Boyd
df4c069a13
Remove backoff from .vector to .tensor (#12292) 2023-02-23 11:36:50 +01:00
Paul O'Leary McCann
1e8bac99f3
Add tests for projects to master (#12303)
* Add tests for projects to master

* Fix git clone related issues on Windows

* Add stat import
2023-02-23 10:22:57 +01:00
Daniël de Kok
e27c60a702
Reimplement distillation with oracle cut size (#12214)
* Improve the correctness of _parse_patch

* If there are no more actions, do not attempt to make further
  transitions, even if not all states are final.
* Assert that the number of actions for a step is the same as
  the number of states.

* Reimplement distillation with oracle cut size

The code for distillation with an oracle cut size was not reimplemented
after the parser refactor. We did not notice, because we did not have
tests for this functionality. This change brings back the functionality
and adds this to the parser tests.

* Rename states2actions to _states_to_actions for consistency

* Test distillation max cuts in NER

* Mark parser/NER tests as slow

* Typo

* Fix invariant in _states_diff_to_actions

* Rename _init_batch -> _init_batch_from_teacher

* Ninja edit the ninja edit

* Check that we raise an exception when we pass the incorrect number or actions

* Remove unnecessary get

Co-authored-by: Madeesh Kannan <shadeMe@users.noreply.github.com>

* Write out condition more explicitly

---------

Co-authored-by: Madeesh Kannan <shadeMe@users.noreply.github.com>
2023-02-21 15:47:18 +01:00
Adriane Boyd
80bc140533
Add grc to langs with lexeme norms in spacy-lookups-data (#12287) 2023-02-16 17:57:02 +01:00
Paul O'Leary McCann
dd3f138830
Use tempfile.TemporaryDirectory (#12285) 2023-02-16 11:08:55 +01:00