Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Carlos-Francisco Méndez-Cruz
/
nlp-preprocessing-pipeline
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Carlos-Francisco Méndez-Cruz
2018-03-08 01:34:55 -0600
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
cec413dfded3415df5a8ed0da73b37ecd16d03d8
cec413df
1 parent
611eb03b
New terminological tagging for CRFs
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
biologicalTermTagging-CRF.py
biologicalTermTagging-CRF.py
View file @
cec413d
...
...
@@ -143,19 +143,19 @@ if __name__ == "__main__":
if
word
.
find
(
'-'
)
>
-
1
:
found
=
False
repetitions
=
word
.
count
(
'-'
)
#
print("repetitions: {}".format(repetitions))
print
(
"repetitions: {}"
.
format
(
repetitions
))
wordOrig
=
word
for
i
in
range
(
0
,
repetitions
):
wordOrig
=
wordOrig
.
replace
(
'-'
,
' '
,
1
)
#
print("Word: {}".format(wordOrig))
print
(
"Word: {}"
.
format
(
wordOrig
))
if
wordOrig
in
hashTermsOrig
[
termTag
]:
#
print("WordOrig: {}".format(wordOrig))
print
(
"WordOrig: {}"
.
format
(
wordOrig
))
found
=
True
line
=
''
for
w
,
l
in
zip
(
word
.
split
(
'-'
),
lemma
.
split
(
'-'
)):
line
+=
w
+
'
\t
'
+
listLine1
[
1
]
+
'
\t
'
+
l
+
' '
+
termTag
+
' TermTag'
+
'
\n
'
line
=
line
.
rstrip
(
'
\n
'
)
print
(
"Line: {}"
.
format
(
line
))
#
print("Line: {}".format(line))
if
not
found
:
line
=
listLine1
[
0
]
+
'
\t
'
+
listLine1
[
1
]
+
'
\t
'
+
listLine2
[
0
]
+
' '
+
termTag
+
' TermTag'
else
:
...
...
Please
register
or
login
to post a comment