Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
texta
texta-mlp-python
Commits
2995c6b6
Commit
2995c6b6
authored
Oct 11, 2021
by
Raul Sirel
Browse files
use universal pos tags
parent
c99d1ef8
Changes
2
Hide whitespace changes
Inline
Side-by-side
VERSION
View file @
2995c6b6
1.14.
0
1.14.
1
texta_mlp/document.py
View file @
2995c6b6
...
...
@@ -248,14 +248,14 @@ class Document:
def
pos_tags
(
self
):
if
"sentences"
in
self
.
analyzers
:
for
i
,
sent
in
enumerate
(
self
.
stanza_sentences
):
tags_in_sent
=
[
word
.
x
pos
if
word
and
word
.
x
pos
and
word
.
x
pos
!=
"_"
else
"X"
if
word
.
x
pos
==
"_"
else
"X"
for
word
in
sent
]
tags_in_sent
=
[
word
.
u
pos
if
word
and
word
.
u
pos
and
word
.
u
pos
!=
"_"
else
"X"
if
word
.
u
pos
==
"_"
else
"X"
for
word
in
sent
]
for
tag
in
tags_in_sent
:
self
.
__pos_tags
.
append
(
tag
)
# if not last item
if
i
+
1
<
len
(
self
.
stanza_sentences
):
self
.
__pos_tags
.
append
(
"LBR"
)
else
:
self
.
__pos_tags
=
[
word
.
x
pos
if
word
and
word
.
x
pos
and
word
.
x
pos
!=
"_"
else
"X"
if
word
.
x
pos
==
"_"
else
"X"
for
word
in
self
.
stanza_words
]
self
.
__pos_tags
=
[
word
.
u
pos
if
word
and
word
.
u
pos
and
word
.
u
pos
!=
"_"
else
"X"
if
word
.
u
pos
==
"_"
else
"X"
for
word
in
self
.
stanza_words
]
def
get_pos_tags
(
self
)
->
str
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment