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
Commits
674d7e14
Commit
674d7e14
authored
1 year ago
by
Manon Blanco
Browse files
Options
Downloads
Patches
Plain Diff
Comply with ruff's PTH rule
parent
d13301eb
No related branches found
No related tags found
1 merge request
!32
Comply with ruff's PTH rule
Pipeline
#143894
passed
1 year ago
Stage: test
Changes
3
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
nerval/evaluate.py
+5
-6
5 additions, 6 deletions
nerval/evaluate.py
pyproject.toml
+2
-0
2 additions, 0 deletions
pyproject.toml
setup.py
+1
-1
1 addition, 1 deletion
setup.py
with
8 additions
and
7 deletions
nerval/evaluate.py
+
5
−
6
View file @
674d7e14
import
logging
import
os
from
csv
import
reader
from
pathlib
import
Path
from
typing
import
List
...
...
@@ -343,14 +342,14 @@ def run(annotation: Path, prediction: Path, threshold: int, verbose: bool) -> di
return
scores
def
run_multiple
(
file_csv
,
folder
,
threshold
,
verbose
):
def
run_multiple
(
file_csv
:
Path
,
folder
:
Path
,
threshold
:
int
,
verbose
:
bool
):
"""
Run the program for multiple files (correlation indicated in the csv file)
"""
# Read the csv in a list
with
open
(
file_csv
)
as
read_obj
:
with
file_csv
.
open
(
)
as
read_obj
:
csv_reader
=
reader
(
read_obj
)
list_cor
=
list
(
csv_reader
)
if
os
.
path
.
isdir
(
folder
):
if
folder
.
is
_
dir
():
list_bio_file
=
list
(
folder
.
rglob
(
"
*.bio
"
))
count
=
0
...
...
@@ -362,10 +361,10 @@ def run_multiple(file_csv, folder, threshold, verbose):
predict
=
None
for
file
in
list_bio_file
:
if
row
[
0
]
==
os
.
path
.
basename
(
file
)
:
if
row
[
0
]
==
file
.
name
:
annot
=
file
for
file
in
list_bio_file
:
if
row
[
1
]
==
os
.
path
.
basename
(
file
)
:
if
row
[
1
]
==
file
.
name
:
predict
=
file
if
annot
and
predict
:
...
...
This diff is collapsed.
Click to expand it.
pyproject.toml
+
2
−
0
View file @
674d7e14
...
...
@@ -33,4 +33,6 @@ select = [
"Q"
,
# flake8-unused-arguments
"ARG"
,
# flake8-use-pathlib
"PTH"
,
]
This diff is collapsed.
Click to expand it.
setup.py
+
1
−
1
View file @
674d7e14
...
...
@@ -27,7 +27,7 @@ def parse_requirements():
setup
(
name
=
"
nerval
"
,
version
=
open
(
"
VERSION
"
).
read
(),
version
=
Path
(
"
VERSION
"
).
read
_text
(),
description
=
"
Tool to evaluate NER on noisy text.
"
,
author
=
"
Teklia
"
,
author_email
=
"
contact@teklia.com
"
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment