Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
nerval
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Named Entity Recognition
nerval
Compare revisions
d39cc82c412de48033dd8314a3e534e8ae70346c to f97736ab67a2211265c30134874bafeb826815d1
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
ner/nerval
Select target project
No results found
f97736ab67a2211265c30134874bafeb826815d1
Select Git revision
Swap
Target
ner/nerval
Select target project
ner/nerval
1 result
d39cc82c412de48033dd8314a3e534e8ae70346c
Select Git revision
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source (2)
Evaluation: Return the displayed rows
· f2cf4eea
Manon Blanco
authored
8 months ago
f2cf4eea
Version 0.3.3rc3
· f97736ab
Yoann Schneider
authored
8 months ago
f97736ab
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
nerval/utils.py
+10
-11
10 additions, 11 deletions
nerval/utils.py
pyproject.toml
+1
-1
1 addition, 1 deletion
pyproject.toml
with
11 additions
and
12 deletions
nerval/utils.py
View file @
f97736ab
...
@@ -2,8 +2,10 @@ from prettytable import MARKDOWN, PrettyTable
...
@@ -2,8 +2,10 @@ from prettytable import MARKDOWN, PrettyTable
from
nerval
import
ALL_ENTITIES
from
nerval
import
ALL_ENTITIES
TABLE_HEADER
=
[
"
tag
"
,
"
predicted
"
,
"
matched
"
,
"
Precision
"
,
"
Recall
"
,
"
F1
"
,
"
Support
"
]
def
print_markdown_table
(
header
:
list
[
str
],
rows
:
list
[
list
])
->
None
:
def
print_markdown_table
(
header
:
list
[
str
],
rows
:
list
[
list
])
->
list
[
list
]:
"""
Prints a Markdown table filled with the provided header and rows.
"""
"""
Prints a Markdown table filled with the provided header and rows.
"""
table
=
PrettyTable
()
table
=
PrettyTable
()
table
.
field_names
=
header
table
.
field_names
=
header
...
@@ -26,8 +28,10 @@ def print_markdown_table(header: list[str], rows: list[list]) -> None:
...
@@ -26,8 +28,10 @@ def print_markdown_table(header: list[str], rows: list[list]) -> None:
table
.
add_rows
(
rows
)
table
.
add_rows
(
rows
)
print
(
table
)
print
(
table
)
return
rows
def
print_results
(
scores
:
dict
)
->
None
:
def
print_results
(
scores
:
dict
)
->
list
[
list
]
:
"""
Display final results.
"""
Display final results.
None values are kept to indicate the absence of a certain tag in either annotation or prediction.
None values are kept to indicate the absence of a certain tag in either annotation or prediction.
...
@@ -50,13 +54,10 @@ def print_results(scores: dict) -> None:
...
@@ -50,13 +54,10 @@ def print_results(scores: dict) -> None:
],
],
)
)
print_markdown_table
(
return
print_markdown_table
(
TABLE_HEADER
,
results
)
[
"
tag
"
,
"
predicted
"
,
"
matched
"
,
"
Precision
"
,
"
Recall
"
,
"
F1
"
,
"
Support
"
],
results
,
)
def
print_result_compact
(
scores
:
dict
)
->
None
:
def
print_result_compact
(
scores
:
dict
)
->
list
[
list
]
:
result
=
[
result
=
[
ALL_ENTITIES
,
ALL_ENTITIES
,
scores
[
ALL_ENTITIES
][
"
predicted
"
],
scores
[
ALL_ENTITIES
][
"
predicted
"
],
...
@@ -66,7 +67,5 @@ def print_result_compact(scores: dict) -> None:
...
@@ -66,7 +67,5 @@ def print_result_compact(scores: dict) -> None:
round
(
scores
[
ALL_ENTITIES
][
"
F1
"
],
3
),
round
(
scores
[
ALL_ENTITIES
][
"
F1
"
],
3
),
scores
[
ALL_ENTITIES
][
"
Support
"
],
scores
[
ALL_ENTITIES
][
"
Support
"
],
]
]
print_markdown_table
(
[
"
tag
"
,
"
predicted
"
,
"
matched
"
,
"
Precision
"
,
"
Recall
"
,
"
F1
"
,
"
Support
"
],
return
print_markdown_table
(
TABLE_HEADER
,
[
result
])
[
result
],
)
This diff is collapsed.
Click to expand it.
pyproject.toml
View file @
f97736ab
...
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
...
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
[project]
[project]
name
=
"teklia-nerval"
name
=
"teklia-nerval"
version
=
"0.3.3rc
2
"
version
=
"0.3.3rc
3
"
description
=
"Tool to evaluate NER on noisy text."
description
=
"Tool to evaluate NER on noisy text."
dynamic
=
[
"dependencies"
]
dynamic
=
[
"dependencies"
]
authors
=
[
authors
=
[
...
...
This diff is collapsed.
Click to expand it.