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
1e001f9b
Commit
1e001f9b
authored
3 years ago
by
Franck Dary
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of
https://gitlab.lis-lab.fr/franck.dary/macaon_data
parents
9d2a9871
93449389
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
scripts/concatW2V.py
+16
-6
16 additions, 6 deletions
scripts/concatW2V.py
scripts/conlluCopyColumn.py
+29
-0
29 additions, 0 deletions
scripts/conlluCopyColumn.py
with
45 additions
and
6 deletions
scripts/concatW2V.py
+
16
−
6
View file @
1e001f9b
...
...
@@ -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.
scripts/conlluCopyColumn.py
0 → 100755
+
29
−
0
View file @
1e001f9b
#! /usr/bin/env python3
import
sys
from
readMCD
import
readMCD
if
len
(
sys
.
argv
)
<
4
:
print
(
"
USAGE : %s fromColumn toColumn file1.conllu file2.conllu...
"
%
sys
.
argv
[
0
],
file
=
sys
.
stderr
)
exit
(
1
)
fromCol
=
sys
.
argv
[
1
]
toCol
=
sys
.
argv
[
2
]
for
filename
in
sys
.
argv
[
3
:]
:
lines
=
[]
for
line
in
open
(
filename
,
"
r
"
)
:
line
=
line
.
strip
()
if
"
# global.columns =
"
in
line
:
line
=
line
+
"
"
+
toCol
conllMCD
,
conllMCDr
=
readMCD
(
line
.
split
(
'
=
'
)[
-
1
].
strip
())
if
len
(
line
)
==
0
or
line
[
0
]
==
'
#
'
:
lines
.
append
(
line
)
continue
splited
=
line
.
split
(
'
\t
'
)
fromValue
=
splited
[
conllMCD
[
fromCol
]]
splited
.
append
(
fromValue
)
lines
.
append
(
"
\t
"
.
join
(
splited
))
with
open
(
filename
,
"
w
"
)
as
out
:
print
(
"
\n
"
.
join
(
lines
),
file
=
out
)
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