Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PSTAL étudiant.e.s
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Carlos Ramisch
PSTAL étudiant.e.s
Commits
5867c799
Commit
5867c799
authored
6 months ago
by
Carlos Ramisch
Browse files
Options
Downloads
Patches
Plain Diff
Minimal update un Sequoia simplification script
parent
c35044ad
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
cm-code/bert-minimal.py
+2
-2
2 additions, 2 deletions
cm-code/bert-minimal.py
cm-code/petits.conllu
+2
-1
2 additions, 1 deletion
cm-code/petits.conllu
lib/conllulib.py
+2
-2
2 additions, 2 deletions
lib/conllulib.py
sequoia/bin/simplify_sequoia.py
+9
-9
9 additions, 9 deletions
sequoia/bin/simplify_sequoia.py
with
15 additions
and
14 deletions
cm-code/bert-minimal.py
+
2
−
2
View file @
5867c799
...
@@ -6,8 +6,8 @@ from transformers import AutoModel, AutoTokenizer
...
@@ -6,8 +6,8 @@ from transformers import AutoModel, AutoTokenizer
name
=
'
almanach/camembert-base
'
name
=
'
almanach/camembert-base
'
#sent = "Des poids lourds et engins en feu \
#sent = "Des poids lourds et engins en feu \
# dans une entreprise en Vendée ."
# dans une entreprise en Vendée ."
#
sent = "La gare routière attend toujours ses illuminations ."
sent
=
"
La gare routière attend toujours ses illuminations .
"
sent
=
"
Quelle surprise ! Arturo a la covid
"
#
sent = "Quelle surprise ! Arturo a la covid"
tok
=
AutoTokenizer
.
from_pretrained
(
name
)
tok
=
AutoTokenizer
.
from_pretrained
(
name
)
model
=
AutoModel
.
from_pretrained
(
name
)
model
=
AutoModel
.
from_pretrained
(
name
)
...
...
This diff is collapsed.
Click to expand it.
cm-code/petits.conllu
+
2
−
1
View file @
5867c799
# global.columns = ID FORM LEMMA UPOS XPOS FEATS HEAD DEPREL DEPS MISC
# text = Les petits ruisseaux font les grandes rivières.
# text = Les petits ruisseaux font les grandes rivières.
1 Les le DET _ Definite=Def|Number=Plur|PronType=Art 3 det _ _
1 Les le DET _ Definite=Def|Number=Plur|PronType=Art 3 det _ _
2 petits petit ADJ _ Gender=Masc|Number=Plur 3 amod _ _
2 petits petit ADJ _ Gender=Masc|Number=Plur 3 amod _ _
...
...
This diff is collapsed.
Click to expand it.
lib/conllulib.py
+
2
−
2
View file @
5867c799
...
@@ -538,8 +538,8 @@ class TransBasedConfig(object):
...
@@ -538,8 +538,8 @@ class TransBasedConfig(object):
`next_act` is a string among
"
SHIFT
"
,
"
RIGHT-ARC-X
"
or
"
LEFT-ARC-X
"
where
`next_act` is a string among
"
SHIFT
"
,
"
RIGHT-ARC-X
"
or
"
LEFT-ARC-X
"
where
"
X
"
is the name of any valid syntactic relation label (deprel).
"
X
"
is the name of any valid syntactic relation label (deprel).
Returns a new syntactic relation added by the action, or None for
"
SHIFT
"
Returns a new syntactic relation added by the action, or None for
"
SHIFT
"
Returned relation is a triple (
mod
, head, deprel) with
modifier
, head, and
Returned relation is a triple (
dep
, head, deprel) with
dependent
, head, and
deprel label if `add_deprel=True` (default), or a pair (
mod
, head) if
deprel label if `add_deprel=True` (default), or a pair (
dep
, head) if
`add_deprel=False`.
`add_deprel=False`.
"""
"""
if next_act ==
"
SHIFT
"
:
if next_act ==
"
SHIFT
"
:
...
...
This diff is collapsed.
Click to expand it.
sequoia/bin/simplify_sequoia.py
+
9
−
9
View file @
5867c799
...
@@ -171,7 +171,7 @@ with open(sys.argv[1], "r", encoding="UTF=8") as f:
...
@@ -171,7 +171,7 @@ with open(sys.argv[1], "r", encoding="UTF=8") as f:
print
(
sent
.
serialize
(),
end
=
""
)
print
(
sent
.
serialize
(),
end
=
""
)
else
:
else
:
np_counter
+=
1
np_counter
+=
1
np_ids
.
append
(
sent
.
metadata
[
"
sent_id
"
])
np_ids
.
append
(
(
sent
.
metadata
[
"
sent_id
"
]
,
len
(
sent
))
)
print
(
"
{} range tokens removed.
\n
"
.
format
(
range_counter
),
file
=
sys
.
stderr
)
print
(
"
{} range tokens removed.
\n
"
.
format
(
range_counter
),
file
=
sys
.
stderr
)
...
@@ -182,4 +182,4 @@ print( "{} supersense tags modified (complex operators).\n".format(mod_ssense_co
...
@@ -182,4 +182,4 @@ print( "{} supersense tags modified (complex operators).\n".format(mod_ssense_co
#print( "{} subrelations removed from deprel.".format(subrel_counter), file=sys.stderr)
#print( "{} subrelations removed from deprel.".format(subrel_counter), file=sys.stderr)
print
(
"
{} non-projective sentences removed:
"
.
format
(
np_counter
),
file
=
sys
.
stderr
)
print
(
"
{} non-projective sentences removed:
"
.
format
(
np_counter
),
file
=
sys
.
stderr
)
print
(
"
,
"
.
join
(
np_ids
),
file
=
sys
.
stderr
)
print
(
"
\n
"
.
join
(
[
f
"
{
np_id
}
->
{
lgth
}
"
for
(
np_id
,
lgth
)
in
np_ids
]
),
file
=
sys
.
stderr
)
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