Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix export_to_brat when there are spaces before new lines #211

Merged
merged 4 commits into from
Aug 8, 2023

Conversation

TheooJ
Copy link
Contributor

@TheooJ TheooJ commented Jul 31, 2023

Description

export_to_brat has been modified to allow the conversion of annotations detected on multiple lines, when there are spaces before newlines.

Ex with the input text:

[text] diverticulite \n
sigmoïdienne compliquée [text]

Before the change the output of doc2brat would have been:

T1	DISO 1732 1746;1747 1770	diverticulite  sigmoïdienne compliquée

Which is not readable by brat because 1) the extra space before the newline is not accounted for, I remove it for counting spans and 2) the begin and end spans of the fragment on the newline were not incremented.

After the change it becomes:

T1	DISO 1732 1745;1747 1770	diverticulite sigmoïdienne compliquée

Checklist

  • If this PR is a bug fix, the bug is documented in the test suite.
  • Changes were documented in the changelog (pending section).
  • If necessary, changes were made to the documentation (eg new pipeline).

@percevalw percevalw force-pushed the pr-brat-connector branch 2 times, most recently from caaa603 to 7b31d99 Compare August 7, 2023 13:03
@percevalw percevalw force-pushed the pr-brat-connector branch 3 times, most recently from f265f6b to 3cea06c Compare August 7, 2023 16:06
@codecov
Copy link

codecov bot commented Aug 7, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (b3c7ddd) 94.30% compared to head (24d3cc1) 94.31%.
Report is 3 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #211   +/-   ##
=======================================
  Coverage   94.30%   94.31%           
=======================================
  Files         246      246           
  Lines        6306     6293   -13     
=======================================
- Hits         5947     5935   -12     
+ Misses        359      358    -1     
Files Changed Coverage Δ
edsnlp/pipelines/ner/umls/patterns.py 100.00% <ø> (+1.92%) ⬆️
edsnlp/connectors/brat.py 90.95% <100.00%> (-0.17%) ⬇️

... and 2 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@percevalw percevalw force-pushed the pr-brat-connector branch 7 times, most recently from 04c77fd to 17ea5c6 Compare August 7, 2023 20:08
@percevalw percevalw merged commit 57e8600 into aphp:master Aug 8, 2023
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants