Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
199
Issues
199
List
Board
Labels
Milestones
Merge Requests
12
Merge Requests
12
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
haskell-gargantext
Commits
424213e0
Commit
424213e0
authored
Sep 21, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[TextFlow] Type rename
parent
4463a799
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
9 deletions
+12
-9
Examples.hs
src/Gargantext/Core/Text/Examples.hs
+1
-1
List.hs
src/Gargantext/Core/Text/List.hs
+4
-1
Metrics.hs
src/Gargantext/Core/Text/Metrics.hs
+3
-3
Matrice.hs
src/Gargantext/Core/Viz/Graph/Distances/Matrice.hs
+4
-4
No files found.
src/Gargantext/Core/Text/Examples.hs
View file @
424213e0
...
@@ -113,7 +113,7 @@ ex_cooc = cooc <$> ex_terms
...
@@ -113,7 +113,7 @@ ex_cooc = cooc <$> ex_terms
-- 0.0, 1.0, 1.0, 0.5,
-- 0.0, 1.0, 1.0, 0.5,
-- 0.0, 0.0, 1.0, 0.5,
-- 0.0, 0.0, 1.0, 0.5,
-- 0.0, 0.0, 0.0, 1.0],(Vector (Z :. 4) [0.5833333333333334,0.5833333333333334,0.75,0.5833333333333334],Vector (Z :. 4) [-0.5833333333333334,-0.4166666666666667,0.41666666666666674,0.5833333333333334]))
-- 0.0, 0.0, 0.0, 1.0],(Vector (Z :. 4) [0.5833333333333334,0.5833333333333334,0.75,0.5833333333333334],Vector (Z :. 4) [-0.5833333333333334,-0.4166666666666667,0.41666666666666674,0.5833333333333334]))
ex_cooc_mat
::
IO
(
Map
Label
Index
,
Matrix
Int
,
Matrix
Double
,
(
DAA
.
Vector
InclusionExclusion
,
DAA
.
Vector
SpecificityGenericity
))
ex_cooc_mat
::
IO
(
Map
Label
Index
,
Matrix
Int
,
Matrix
Double
,
(
DAA
.
Vector
GenericityInclusion
,
DAA
.
Vector
SpecificityExclusion
))
ex_cooc_mat
=
do
ex_cooc_mat
=
do
m
<-
ex_cooc
m
<-
ex_cooc
let
(
ti
,
_
)
=
createIndices
m
let
(
ti
,
_
)
=
createIndices
m
...
...
src/Gargantext/Core/Text/List.hs
View file @
424213e0
...
@@ -140,7 +140,10 @@ buildNgramsTermsList l n m s uCid mCid = do
...
@@ -140,7 +140,10 @@ buildNgramsTermsList l n m s uCid mCid = do
-- Get Local Scores now for selected grouped ngrams
-- Get Local Scores now for selected grouped ngrams
selectedTerms
=
Set
.
toList
$
List
.
foldl'
selectedTerms
=
Set
.
toList
$
List
.
foldl'
(
\
set
(
GroupedText
_
l
_
g
_
_
)
->
Set
.
union
set
$
Set
.
union
g
$
Set
.
singleton
l
)
(
\
set
(
GroupedText
_
l
_
g
_
_
)
->
Set
.
union
set
$
Set
.
union
g
$
Set
.
singleton
l
)
Set
.
empty
Set
.
empty
(
groupedMonoHead
<>
groupedMultHead
)
(
groupedMonoHead
<>
groupedMultHead
)
...
...
src/Gargantext/Core/Text/Metrics.hs
View file @
424213e0
...
@@ -57,8 +57,8 @@ scored = map2scored . (pcaReduceTo (Dimension 2)) . scored2map
...
@@ -57,8 +57,8 @@ scored = map2scored . (pcaReduceTo (Dimension 2)) . scored2map
-- TODO change type with (x,y)
-- TODO change type with (x,y)
data
Scored
ts
=
Scored
data
Scored
ts
=
Scored
{
_scored_terms
::
!
ts
{
_scored_terms
::
!
ts
,
_scored_incExc
::
!
InclusionEx
clusion
,
_scored_incExc
::
!
GenericityIn
clusion
,
_scored_speGen
::
!
Specificity
Genericity
,
_scored_speGen
::
!
Specificity
Exclusion
}
deriving
(
Show
)
}
deriving
(
Show
)
localMetrics'
::
Ord
t
=>
Map
(
t
,
t
)
Int
->
Map
t
(
Vec
.
Vector
Double
)
localMetrics'
::
Ord
t
=>
Map
(
t
,
t
)
Int
->
Map
t
(
Vec
.
Vector
Double
)
...
@@ -76,7 +76,7 @@ localMetrics' m = Map.fromList $ zipWith (\(_,t) (inc,spe) -> (t, Vec.fromList [
...
@@ -76,7 +76,7 @@ localMetrics' m = Map.fromList $ zipWith (\(_,t) (inc,spe) -> (t, Vec.fromList [
-- TODO in the textflow we end up needing these indices , it might be
-- TODO in the textflow we end up needing these indices , it might be
-- better to compute them earlier and pass them around.
-- better to compute them earlier and pass them around.
scored'
::
Ord
t
=>
Map
(
t
,
t
)
Int
->
[
Scored
t
]
scored'
::
Ord
t
=>
Map
(
t
,
t
)
Int
->
[
Scored
t
]
scored'
m
=
zipWith
(
\
(
_
,
t
)
(
inc
,
spe
)
->
Scored
t
(
inc
)
(
spe
)
)
(
Map
.
toList
fi
)
scores
scored'
m
=
zipWith
(
\
(
_
,
t
)
(
inc
,
spe
)
->
Scored
t
inc
spe
)
(
Map
.
toList
fi
)
scores
where
where
(
ti
,
fi
)
=
createIndices
m
(
ti
,
fi
)
=
createIndices
m
(
is
,
ss
)
=
incExcSpeGen
$
cooc2mat
ti
m
(
is
,
ss
)
=
incExcSpeGen
$
cooc2mat
ti
m
...
...
src/Gargantext/Core/Viz/Graph/Distances/Matrice.hs
View file @
424213e0
...
@@ -196,7 +196,7 @@ measureConditional m = run $ matProba (dim m)
...
@@ -196,7 +196,7 @@ measureConditional m = run $ matProba (dim m)
-- in the corpus and _[n_{ij}\] the number of its occurrences we get:
-- in the corpus and _[n_{ij}\] the number of its occurrences we get:
--
--
-- \[P_c=max(\frac{n_i}{n_{ij}},\frac{n_j}{n_{ij}} )\]
-- \[P_c=max(\frac{n_i}{n_{ij}},\frac{n_j}{n_{ij}} )\]
conditional'
::
Matrix
Int
->
(
Matrix
InclusionExclusion
,
Matrix
SpecificityGenericity
)
conditional'
::
Matrix
Int
->
(
Matrix
GenericityInclusion
,
Matrix
SpecificityExclusion
)
conditional'
m
=
(
run
$
ie
$
map
fromIntegral
$
use
m
conditional'
m
=
(
run
$
ie
$
map
fromIntegral
$
use
m
,
run
$
sg
$
map
fromIntegral
$
use
m
,
run
$
sg
$
map
fromIntegral
$
use
m
)
)
...
@@ -450,15 +450,15 @@ Jean-Philippe Cointet (CREA, TSV), David Chavalarias (CREA) (Submitted
...
@@ -450,15 +450,15 @@ Jean-Philippe Cointet (CREA, TSV), David Chavalarias (CREA) (Submitted
on 15 Mar 2008), Networks and Heterogeneous Media 3, 2 (2008) 267 - 276,
on 15 Mar 2008), Networks and Heterogeneous Media 3, 2 (2008) 267 - 276,
arXiv:0803.2315 [cs.OH]
arXiv:0803.2315 [cs.OH]
-}
-}
type
InclusionEx
clusion
=
Double
type
GenericityIn
clusion
=
Double
type
Specificity
Genericity
=
Double
type
Specificity
Exclusion
=
Double
data
SquareMatrix
=
SymetricMatrix
|
NonSymetricMatrix
data
SquareMatrix
=
SymetricMatrix
|
NonSymetricMatrix
type
SymetricMatrix
=
Matrix
type
SymetricMatrix
=
Matrix
type
NonSymetricMatrix
=
Matrix
type
NonSymetricMatrix
=
Matrix
incExcSpeGen
::
Matrix
Int
->
(
Vector
InclusionExclusion
,
Vector
SpecificityGenericity
)
incExcSpeGen
::
Matrix
Int
->
(
Vector
GenericityInclusion
,
Vector
SpecificityExclusion
)
incExcSpeGen
m
=
(
run'
inclusionExclusion
m
,
run'
specificityGenericity
m
)
incExcSpeGen
m
=
(
run'
inclusionExclusion
m
,
run'
specificityGenericity
m
)
where
where
run'
fun
mat
=
run
$
fun
$
map
fromIntegral
$
use
mat
run'
fun
mat
=
run
$
fun
$
map
fromIntegral
$
use
mat
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment