Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
macaon_data
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Franck Dary
macaon_data
Commits
2f3c0537
Commit
2f3c0537
authored
2 years ago
by
Franck Dary
Browse files
Options
Downloads
Patches
Plain Diff
fixed script to generate embeddings from lexicon
parent
33789c0f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/lefff2w2v.py
+4
-2
4 additions, 2 deletions
scripts/lefff2w2v.py
with
4 additions
and
2 deletions
scripts/lefff2w2v.py
+
4
−
2
View file @
2f3c0537
...
...
@@ -92,7 +92,9 @@ if __name__ == "__main__" :
form
=
splited
[
0
].
lower
()
pos
=
lefffPOS2UD
[
splited
[
1
]]
# In lefff there might be spaces in forms. W2v format don't allow it. We replace space by dotted circle.
form
.
replace
(
"
"
,
"
◌
"
)
form
=
form
.
replace
(
"
"
,
"
◌
"
)
if
"
"
in
form
:
print
(
"
HERE
'
%s
'"
%
form
,
file
=
sys
.
stderr
)
if
pos
not
in
allPos
:
print
(
"
ERROR: Unknown pos
'
%s
'
(check allPos in the script)
"
%
pos
,
file
=
sys
.
stderr
)
if
form
not
in
form2pos
:
...
...
@@ -122,7 +124,7 @@ if __name__ == "__main__" :
continue
form
=
splited
[
conllMCD
[
"
FORM
"
]].
lower
()
pos
=
splited
[
conllMCD
[
"
UPOS
"
]].
lower
()
form
.
replace
(
"
"
,
"
◌
"
)
form
=
form
.
replace
(
"
"
,
"
◌
"
)
if
pos
not
in
allPos
:
print
(
"
ERROR: Unknown pos
'
%s
'
(check allPos in the script)
"
%
pos
,
file
=
sys
.
stderr
)
if
form
not
in
form2pos
:
...
...
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