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
9ebeb1d7
There was an error fetching the commit references. Please try again later.
Commit
9ebeb1d7
authored
2 years ago
by
Martyna Wiącek
Browse files
Options
Downloads
Patches
Plain Diff
save head and separate predictions in json file by line
parent
de9301ad
No related merge requests found
Pipeline
#9560
passed with stage
in 2 minutes and 21 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
combo/data/api.py
+1
-0
1 addition, 0 deletions
combo/data/api.py
combo/predict.py
+1
-1
1 addition, 1 deletion
combo/predict.py
with
2 additions
and
1 deletion
combo/data/api.py
+
1
−
0
View file @
9ebeb1d7
...
@@ -57,6 +57,7 @@ class Sentence:
...
@@ -57,6 +57,7 @@ class Sentence:
return
json
.
dumps
({
return
json
.
dumps
({
"
tokens
"
:
[(
t
.
token
,
t
.
lemma
,
t
.
upostag
,
t
.
xpostag
,
t
.
feats
,
t
.
head
,
t
.
deprel
)
for
t
in
self
.
tokens
],
"
tokens
"
:
[(
t
.
token
,
t
.
lemma
,
t
.
upostag
,
t
.
xpostag
,
t
.
feats
,
t
.
head
,
t
.
deprel
)
for
t
in
self
.
tokens
],
# "sentence_embedding": self.sentence_embedding,
# "sentence_embedding": self.sentence_embedding,
"
head
"
:
[
t
.
head
for
t
in
self
.
tokens
],
"
relation_distribution_hash
"
:
hash
,
"
relation_distribution_hash
"
:
hash
,
"
path_file
"
:
str
(
os
.
path
.
join
(
save_relation_distribution_path
,
hash
+
'
.npz
'
))
"
path_file
"
:
str
(
os
.
path
.
join
(
save_relation_distribution_path
,
hash
+
'
.npz
'
))
},
cls
=
NumpyArrayEncoder
)
},
cls
=
NumpyArrayEncoder
)
...
...
This diff is collapsed.
Click to expand it.
combo/predict.py
+
1
−
1
View file @
9ebeb1d7
...
@@ -136,7 +136,7 @@ class COMBO(predictor.Predictor):
...
@@ -136,7 +136,7 @@ class COMBO(predictor.Predictor):
else
:
else
:
if
not
os
.
path
.
exists
(
self
.
save_relation_distribution_path
):
if
not
os
.
path
.
exists
(
self
.
save_relation_distribution_path
):
os
.
makedirs
(
self
.
save_relation_distribution_path
)
os
.
makedirs
(
self
.
save_relation_distribution_path
)
return
outputs
.
to_json
(
self
.
save_relation_distribution_path
)
return
outputs
.
to_json
(
self
.
save_relation_distribution_path
)
+
"
\n
"
@staticmethod
@staticmethod
def
_to_input_json
(
sentence
:
str
):
def
_to_input_json
(
sentence
:
str
):
...
...
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