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
31199ab8
Commit
31199ab8
authored
Mar 10, 2021
by
Raul Sirel
Browse files
change lang field name
parent
5082f4ef
Pipeline
#4882
canceled with stages
in 3 minutes and 18 seconds
Changes
3
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
VERSION
View file @
31199ab8
1.9.
0
1.9.
1
tests/test_mlp.py
View file @
31199ab8
...
...
@@ -37,13 +37,13 @@ def test_mlp_process(mlp: MLP):
assert
"lemmas"
in
mlp_text
assert
isinstance
(
mlp_text
[
"lemmas"
],
str
)
is
True
assert
"lang"
in
mlp_text
assert
isinstance
(
mlp_text
[
"lang"
],
dict
)
is
True
assert
"lang
uage
"
in
mlp_text
assert
isinstance
(
mlp_text
[
"lang
uage
"
],
dict
)
is
True
assert
"texta_facts"
in
result
assert
isinstance
(
result
[
"texta_facts"
],
list
)
is
True
if
mlp_text
[
"lang"
][
"analysis_lang"
]
in
(
"ru"
,
"ar"
):
if
mlp_text
[
"lang
uage
"
][
"analysis_lang"
]
in
(
"ru"
,
"ar"
):
assert
"transliteration"
in
mlp_text
assert
"style"
not
in
mlp_text
[
"text"
]
...
...
texta_mlp/document.py
View file @
31199ab8
...
...
@@ -136,7 +136,7 @@ class Document:
container
=
dict
()
container
[
"text"
]
=
self
.
get_words
()
texta_facts
=
self
.
facts_to_json
()
container
[
"lang"
]
=
{
"detected_lang"
:
self
.
dominant_language_code
,
container
[
"lang
uage
"
]
=
{
"detected_lang"
:
self
.
dominant_language_code
,
"analysis_lang"
:
self
.
analysis_lang
}
if
"lemmas"
in
self
.
analyzers
:
container
[
"lemmas"
]
=
self
.
get_lemma
()
if
"pos_tags"
in
self
.
analyzers
:
container
[
"pos_tags"
]
=
self
.
get_pos_tags
()
...
...
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