Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
combo
Manage
Activity
Members
Labels
Plan
Issues
20
Issue boards
Milestones
Wiki
Redmine
Code
Merge requests
2
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Syntactic Tools
combo
Commits
aa2b4d90
There was an error fetching the commit references. Please try again later.
Commit
aa2b4d90
authored
4 years ago
by
Mateusz Klimaszewski
Committed by
Mateusz Klimaszewski
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix console prediction.
parent
a5d36a1c
1 merge request
!5
Merge develop to master with documentation changes.
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
combo/main.py
+3
-0
3 additions, 0 deletions
combo/main.py
combo/predict.py
+3
-0
3 additions, 0 deletions
combo/predict.py
with
6 additions
and
0 deletions
combo/main.py
+
3
−
0
View file @
aa2b4d90
...
@@ -146,6 +146,9 @@ def run(_):
...
@@ -146,6 +146,9 @@ def run(_):
else
:
else
:
use_dataset_reader
=
FLAGS
.
conllu_format
use_dataset_reader
=
FLAGS
.
conllu_format
predictor
=
_get_predictor
()
predictor
=
_get_predictor
()
if
FLAGS
.
input_file
==
"
-
"
:
use_dataset_reader
=
False
predictor
.
without_sentence_embedding
=
True
if
use_dataset_reader
:
if
use_dataset_reader
:
predictor
.
line_to_conllu
=
True
predictor
.
line_to_conllu
=
True
if
FLAGS
.
silent
:
if
FLAGS
.
silent
:
...
...
This diff is collapsed.
Click to expand it.
combo/predict.py
+
3
−
0
View file @
aa2b4d90
...
@@ -32,6 +32,7 @@ class SemanticMultitaskPredictor(predictor.Predictor):
...
@@ -32,6 +32,7 @@ class SemanticMultitaskPredictor(predictor.Predictor):
self
.
_dataset_reader
.
generate_labels
=
False
self
.
_dataset_reader
.
generate_labels
=
False
self
.
_dataset_reader
.
lazy
=
True
self
.
_dataset_reader
.
lazy
=
True
self
.
_tokenizer
=
tokenizer
self
.
_tokenizer
=
tokenizer
self
.
without_sentence_embedding
=
False
self
.
line_to_conllu
=
line_to_conllu
self
.
line_to_conllu
=
line_to_conllu
def
__call__
(
self
,
sentence
:
Union
[
str
,
List
[
str
],
List
[
List
[
str
]],
List
[
data
.
Sentence
]]):
def
__call__
(
self
,
sentence
:
Union
[
str
,
List
[
str
],
List
[
List
[
str
]],
List
[
data
.
Sentence
]]):
...
@@ -127,6 +128,8 @@ class SemanticMultitaskPredictor(predictor.Predictor):
...
@@ -127,6 +128,8 @@ class SemanticMultitaskPredictor(predictor.Predictor):
def
dump_line
(
self
,
outputs
:
data
.
Sentence
)
->
str
:
def
dump_line
(
self
,
outputs
:
data
.
Sentence
)
->
str
:
# Check whether serialized (str) tree or token's list
# Check whether serialized (str) tree or token's list
# Serialized tree has already separators between lines
# Serialized tree has already separators between lines
if
self
.
without_sentence_embedding
:
outputs
.
sentence_embedding
=
[]
if
self
.
line_to_conllu
:
if
self
.
line_to_conllu
:
return
sentence2conllu
(
outputs
,
keep_semrel
=
self
.
_dataset_reader
.
use_sem
).
serialize
()
return
sentence2conllu
(
outputs
,
keep_semrel
=
self
.
_dataset_reader
.
use_sem
).
serialize
()
else
:
else
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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