Skip to content

Define EntitySpan class for cleaner NER interface - #1363

Merged
bact merged 3 commits into
PyThaiNLP:devfrom
bact:nerentity
Mar 24, 2026
Merged

Define EntitySpan class for cleaner NER interface#1363
bact merged 3 commits into
PyThaiNLP:devfrom
bact:nerentity

Conversation

@bact

@bact bact commented Mar 24, 2026

Copy link
Copy Markdown
Member

What do these changes do

Define EntitySpan class with predefined keys for cleaner NER interface

What was wrong

Was using dict[str, Any] that has to manually keep the keys consistent

  • Passed code styles and structures
  • Passed code linting checks and unit test

bact added 3 commits March 24, 2026 00:10
Instead of plain dict, use NEREntity with pre-defined keys

```python
class NEREntity(TypedDict):
    text: list[str]
    span: list[int]
    entity_type: str
```
@bact bact added the refactoring a technical improvement which does not add any new features or change existing features. label Mar 24, 2026
@bact bact added this to PyThaiNLP Mar 24, 2026
@bact bact moved this to In progress in PyThaiNLP Mar 24, 2026
@bact bact added this to the 5.3.3 milestone Mar 24, 2026
@sonarqubecloud

Copy link
Copy Markdown

@bact
bact merged commit 82d4302 into PyThaiNLP:dev Mar 24, 2026
26 checks passed
@bact
bact deleted the nerentity branch March 24, 2026 00:24
@github-project-automation github-project-automation Bot moved this from In progress to Done in PyThaiNLP Mar 24, 2026
@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 66.574% (+0.02%) from 66.557%
when pulling 83d8e67 on bact:nerentity
into e9a80ad on PyThaiNLP:dev.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactoring a technical improvement which does not add any new features or change existing features.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants