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
18f1683c
Commit
18f1683c
authored
4 years ago
by
Franck Dary
Browse files
Options
Downloads
Patches
Plain Diff
Using w2v on output from udpipe horizontal output instead of on raw text
parent
26f25b22
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
UD_any/data/Makefile
+2
-2
2 additions, 2 deletions
UD_any/data/Makefile
UD_any/data/pretrainEmbeddings.py
+20
-1
20 additions, 1 deletion
UD_any/data/pretrainEmbeddings.py
UD_any/train.sh
+2
-9
2 additions, 9 deletions
UD_any/train.sh
with
24 additions
and
12 deletions
UD_any/data/Makefile
+
2
−
2
View file @
18f1683c
...
...
@@ -42,8 +42,8 @@ transitions: all_no_test.conllu
texts
:
./getRawText.py
$(
CONLL2TXT
)
$(
TRAIN_FILES
)
$(
DEV_FILES
)
$(
TEST_FILES
)
pretrain
:
texts
./pretrainEmbeddings.py
train.txt
64 pretrained.w2v
pretrain
:
./pretrainEmbeddings.py
$(
TRAIN_FILES
)
64 pretrained.w2v
$(FPLM_FILENAME)
:
all_no_test.conllu
$(
SCRIPTS
)
/conllu2fplm.py
$<
>
$@
...
...
This diff is collapsed.
Click to expand it.
UD_any/data/pretrainEmbeddings.py
+
20
−
1
View file @
18f1683c
...
...
@@ -21,6 +21,25 @@ if __name__ == "__main__" :
if
which
(
"
word2vec
"
)
is
None
:
exit
(
0
)
p
=
subprocess
.
Popen
(
"
word2vec -cbow 0 -size %s -window 10 -negative 5 -hs 0 -sample 1e-1 -threads 2 -binary 0 -iter 15 -min-count 2 -train %s -output %s
"
%
(
embeddingsSize
,
pathToFile
,
target
),
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
,
shell
=
True
)
p
=
subprocess
.
Popen
(
"
~/Documents/ud_pipe/src/udpipe --output=horizontal none %s > in.text
"
%
pathToFile
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
,
shell
=
True
)
p
.
wait
()
args
=
[
"
word2vec
"
,
"
-cbow 0
"
,
"
-size %s
"
%
embeddingsSize
,
"
-window 10
"
,
"
-negative 5
"
,
"
-hs 0
"
,
"
-sample 1e-1
"
,
"
-threads 4
"
,
"
-binary 0
"
,
"
-iter 15
"
,
"
-min-count 2
"
,
"
-train in.text
"
,
"
-output %s
"
%
target
,
]
p
=
subprocess
.
Popen
(
"
"
.
join
(
args
),
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
,
shell
=
True
)
p
.
wait
()
This diff is collapsed.
Click to expand it.
UD_any/train.sh
+
2
−
9
View file @
18f1683c
...
...
@@ -40,7 +40,6 @@ DEV=$EXPPATH"/data/dev.conllu"
DEVRAW
=
$EXPPATH
"/data/dev.txt"
TEST
=
$EXPPATH
"/data/test.conllu"
TESTRAW
=
$EXPPATH
"/data/test.txt"
W2V
=
$EXPPATH
"/data/pretrained.w2v"
if
test
!
-f
$TRAIN
;
then
...
...
@@ -67,19 +66,13 @@ if [ "$MODE" = "txt" ]; then
fi
fi
if
test
-f
$W2V
;
then
>
&2
echo
"Using W2V :"
$W2V
W2V
=
"--pretrainedEmbeddings "
$W2V
fi
if
[
"
$MODE
"
=
"tsv"
]
;
then
macaon train
--model
$EXPPATH
--trainTSV
$TRAIN
--devTSV
$DEV
$W2V
"
$@
"
||
exit
1
macaon train
--model
$EXPPATH
--trainTSV
$TRAIN
--devTSV
$DEV
"
$@
"
||
exit
1
exit
0
fi
if
[
"
$MODE
"
=
"txt"
]
;
then
macaon train
--model
$EXPPATH
--trainTSV
$TRAIN
--trainTXT
$TRAINRAW
--devTSV
$DEV
--devTXT
$DEVRAW
$W2V
"
$@
"
||
exit
1
macaon train
--model
$EXPPATH
--trainTSV
$TRAIN
--trainTXT
$TRAINRAW
--devTSV
$DEV
--devTXT
$DEVRAW
"
$@
"
||
exit
1
exit
0
fi
...
...
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