Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
combo
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Redmine
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Syntactic Tools
combo
Commits
aa2b4d90
Commit
aa2b4d90
authored
Nov 9, 2020
by
Mateusz Klimaszewski
Committed by
Mateusz Klimaszewski
Nov 16, 2020
Browse files
Options
Downloads
Patches
Plain Diff
Fix console prediction.
parent
a5d36a1c
No related branches found
No related tags found
1 merge request
!5
Merge develop to master with documentation changes.
Changes
2
Show 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%
Loading
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