Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
DAN
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Container Registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Automatic Text Recognition
DAN
Commits
2f61d377
Commit
2f61d377
authored
1 year ago
by
Yoann Schneider
Browse files
Options
Downloads
Plain Diff
Merge branch 'do-not-edit-ner-text' into 'main'
Keep NER text as is Closes
#246
See merge request
!336
parents
c0eb5bb8
9d66f700
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!336
Keep NER text as is
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dan/ocr/predict/attention.py
+2
-5
2 additions, 5 deletions
dan/ocr/predict/attention.py
with
2 additions
and
5 deletions
dan/ocr/predict/attention.py
+
2
−
5
View file @
2f61d377
...
...
@@ -93,7 +93,7 @@ def compute_prob_by_ner(
return
zip
(
*
[
(
f
"
{
characters
[
current
:
next_token
]
}
"
.
replace
(
"
\n
"
,
"
"
)
,
characters
[
current
:
next_token
],
np
.
mean
(
probabilities
[
current
:
next_token
]),
)
for
current
,
next_token
in
indices
...
...
@@ -154,10 +154,7 @@ def split_text(
return
[],
[]
indices
=
build_ner_indices
(
text
,
tokens
)
text_split
=
[
f
"
{
text
[
current
:
next_token
]
}
"
.
replace
(
"
\n
"
,
"
"
)
for
current
,
next_token
in
indices
]
text_split
=
[
text
[
current
:
next_token
]
for
current
,
next_token
in
indices
]
case
_
:
logger
.
error
(
f
"
Level should be either
{
list
(
map
(
str
,
Level
))
}
"
)
return
[],
[]
...
...
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