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
4c716375
Commit
4c716375
authored
3 years ago
by
Franck Dary
Browse files
Options
Downloads
Patches
Plain Diff
Fixed script concatW2V
parent
7b65bf7f
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/concatW2V.py
+16
-6
16 additions, 6 deletions
scripts/concatW2V.py
with
16 additions
and
6 deletions
scripts/concatW2V.py
+
16
−
6
View file @
4c716375
...
...
@@ -2,17 +2,27 @@
import
sys
hadFirst
=
False
nbLines
=
0
embSize
=
None
for
filename
in
sys
.
argv
[
1
:]
:
prefix
=
filename
.
split
(
'
/
'
)[
-
1
].
split
(
'
.
'
)[
0
]
for
line
in
open
(
filename
,
"
r
"
)
:
line
=
line
.
strip
()
splited
=
line
.
split
()
if
len
(
splited
)
==
2
:
if
hadFirst
:
continue
hadFirst
=
True
print
(
line
)
if
embSize
is
None
:
embSize
=
int
(
splited
[
1
])
elif
embSize
!=
int
(
splited
[
1
])
:
print
(
"
ERROR : incompatibles embedings sizes %d and %d
"
%
(
embSize
,
int
(
splited
[
1
])),
file
=
sys
.
stderr
)
exit
(
1
)
else
:
nbLines
+=
1
print
(
nbLines
,
embSize
)
for
filename
in
sys
.
argv
[
1
:]
:
prefix
=
filename
.
split
(
'
/
'
)[
-
1
].
split
(
'
.
'
)[
0
]
for
line
in
open
(
filename
,
"
r
"
)
:
line
=
line
.
strip
()
splited
=
line
.
split
()
if
len
(
splited
)
>
2
:
print
(
prefix
+
"
_
"
+
line
)
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