Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
manuscrit
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package 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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alice Brenon
manuscrit
Commits
bec657f0
Commit
bec657f0
authored
3 months ago
by
Alice Brenon
Browse files
Options
Downloads
Patches
Plain Diff
Improve bivariate specificity graph to work directly on measures from TXM
parent
88832dad
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
visualisation/BivariateSpecificity.py
+6
-3
6 additions, 3 deletions
visualisation/BivariateSpecificity.py
visualisation/LongFormatFromTXM.py
+6
-0
6 additions, 0 deletions
visualisation/LongFormatFromTXM.py
with
12 additions
and
3 deletions
visualisation/BivariateSpecificity.py
+
6
−
3
View file @
bec657f0
#!/usr/bin/env python3
from
GEODE
import
tabular
from
LongFormatFromTXM
import
extractBivariate
,
toLongFormat
from
color
import
qualitative
import
matplotlib.pyplot
as
plot
import
seaborn
import
sys
def
bivariateSpecificity
(
inputTSV
,
outputPNG
):
specificities
=
tabular
(
inputTSV
)
specificities
=
toLongFormat
(
tabular
(
inputTSV
))
bivariate
=
extractBivariate
(
specificities
,
'
_
'
,
[
'
domaine
'
,
'
auteur
'
])
ax
=
seaborn
.
catplot
(
data
=
specificities
,
x
=
'
auteur
'
,
y
=
'
Spécificité
'
,
col
=
'
domaine
'
,
hue
=
'
lemme
'
,
kind
=
'
bar
'
,
zorder
=
3
,
palette
=
qualitative
)
data
=
bivariate
.
reset_index
(),
x
=
'
auteur
'
,
y
=
'
Spécificité
'
,
col
=
'
domaine
'
,
hue
=
'
lemme
'
,
kind
=
'
bar
'
,
zorder
=
3
,
height
=
3.5
,
aspect
=
1.6
,
palette
=
qualitative
)
ax
.
despine
(
left
=
True
)
ax
.
set_xlabels
(
''
)
ax
.
set_titles
(
'
{col_name}
'
)
...
...
This diff is collapsed.
Click to expand it.
visualisation/LongFormatFromTXM.py
+
6
−
0
View file @
bec657f0
...
...
@@ -12,6 +12,12 @@ def toLongFormat(txmData):
specificities
.
name
=
'
Spécificité
'
return
pandas
.
DataFrame
(
specificities
)
def
extractBivariate
(
specificities
,
sep
,
into
):
index
=
specificities
.
index
.
names
columns
=
specificities
.
columns
specificities
[
into
]
=
[
*
specificities
.
index
.
map
(
lambda
r
:
r
[
0
].
split
(
sep
))]
return
specificities
.
reset_index
().
set_index
(
into
+
index
[
1
:])[
columns
]
def
convert
(
inputTSV
,
outputTSV
):
toLongFormat
(
tabular
(
inputTSV
)).
to_csv
(
outputTSV
,
sep
=
'
\t
'
)
...
...
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