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
145
Issues
145
List
Board
Labels
Milestones
Merge Requests
6
Merge Requests
6
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
99b5de7d
Commit
99b5de7d
authored
Sep 02, 2019
by
qlobbe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ready for quality score
parent
92b4221b
Pipeline
#554
failed with stage
Changes
6
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
75 additions
and
114 deletions
+75
-114
AdaptativePhylo.hs
src/Gargantext/Viz/AdaptativePhylo.hs
+0
-2
PhyloExample.hs
src/Gargantext/Viz/Phylo/PhyloExample.hs
+1
-1
PhyloMaker.hs
src/Gargantext/Viz/Phylo/PhyloMaker.hs
+3
-3
PhyloTools.hs
src/Gargantext/Viz/Phylo/PhyloTools.hs
+7
-7
SynchronicClustering.hs
src/Gargantext/Viz/Phylo/SynchronicClustering.hs
+2
-2
TemporalMatching.hs
src/Gargantext/Viz/Phylo/TemporalMatching.hs
+62
-99
No files found.
src/Gargantext/Viz/AdaptativePhylo.hs
View file @
99b5de7d
...
@@ -87,7 +87,6 @@ data Config =
...
@@ -87,7 +87,6 @@ data Config =
,
corpusParser
::
CorpusParser
,
corpusParser
::
CorpusParser
,
phyloName
::
Text
,
phyloName
::
Text
,
phyloLevel
::
Int
,
phyloLevel
::
Int
,
phyloQuality
::
Double
,
phyloProximity
::
Proximity
,
phyloProximity
::
Proximity
,
timeUnit
::
TimeUnit
,
timeUnit
::
TimeUnit
,
contextualUnit
::
ContextualUnit
,
contextualUnit
::
ContextualUnit
...
@@ -103,7 +102,6 @@ defaultConfig =
...
@@ -103,7 +102,6 @@ defaultConfig =
,
corpusParser
=
Csv
1000
,
corpusParser
=
Csv
1000
,
phyloName
=
pack
"Default Phylo"
,
phyloName
=
pack
"Default Phylo"
,
phyloLevel
=
2
,
phyloLevel
=
2
,
phyloQuality
=
0.5
,
phyloProximity
=
WeightedLogJaccard
10
0
0.05
,
phyloProximity
=
WeightedLogJaccard
10
0
0.05
,
timeUnit
=
Year
3
1
5
,
timeUnit
=
Year
3
1
5
,
contextualUnit
=
Fis
2
4
,
contextualUnit
=
Fis
2
4
...
...
src/Gargantext/Viz/Phylo/PhyloExample.hs
View file @
99b5de7d
...
@@ -66,7 +66,7 @@ phyloBase = toPhyloBase docs mapList config
...
@@ -66,7 +66,7 @@ phyloBase = toPhyloBase docs mapList config
phyloCooc
::
Map
Date
Cooc
phyloCooc
::
Map
Date
Cooc
phyloCooc
=
docsToTimeScaleCooc
docs
(
foundations
^.
foundations_roots
)
config
phyloCooc
=
docsToTimeScaleCooc
docs
(
foundations
^.
foundations_roots
)
periods
::
[(
Date
,
Date
)]
periods
::
[(
Date
,
Date
)]
...
...
src/Gargantext/Viz/Phylo/PhyloMaker.hs
View file @
99b5de7d
...
@@ -173,8 +173,8 @@ ngramsToCooc ngrams coocs =
...
@@ -173,8 +173,8 @@ ngramsToCooc ngrams coocs =
-- | To transform the docs into a time map of coocurency matrix
-- | To transform the docs into a time map of coocurency matrix
docsToTimeScaleCooc
::
[
Document
]
->
Vector
Ngrams
->
Config
->
Map
Date
Cooc
docsToTimeScaleCooc
::
[
Document
]
->
Vector
Ngrams
->
Map
Date
Cooc
docsToTimeScaleCooc
docs
fdt
conf
=
docsToTimeScaleCooc
docs
fdt
=
let
mCooc
=
fromListWith
sumCooc
let
mCooc
=
fromListWith
sumCooc
$
map
(
\
(
_d
,
l
)
->
(
_d
,
listToMatrix
l
))
$
map
(
\
(
_d
,
l
)
->
(
_d
,
listToMatrix
l
))
$
map
(
\
doc
->
(
date
doc
,
sort
$
ngramsToIdx
(
text
doc
)
fdt
))
docs
$
map
(
\
doc
->
(
date
doc
,
sort
$
ngramsToIdx
(
text
doc
)
fdt
))
docs
...
@@ -229,7 +229,7 @@ toPhyloBase docs lst conf =
...
@@ -229,7 +229,7 @@ toPhyloBase docs lst conf =
periods
=
toPeriods
(
sort
$
nub
$
map
date
docs
)
(
getTimePeriod
$
timeUnit
conf
)
(
getTimeStep
$
timeUnit
conf
)
periods
=
toPeriods
(
sort
$
nub
$
map
date
docs
)
(
getTimePeriod
$
timeUnit
conf
)
(
getTimeStep
$
timeUnit
conf
)
in
trace
(
"
\n
"
<>
"-- | Create PhyloBase out of "
<>
show
(
length
docs
)
<>
" docs
\n
"
)
in
trace
(
"
\n
"
<>
"-- | Create PhyloBase out of "
<>
show
(
length
docs
)
<>
" docs
\n
"
)
$
Phylo
foundations
$
Phylo
foundations
(
docsToTimeScaleCooc
docs
(
foundations
^.
foundations_roots
)
conf
)
(
docsToTimeScaleCooc
docs
(
foundations
^.
foundations_roots
))
(
docsToTimeScaleNb
docs
)
(
docsToTimeScaleNb
docs
)
params
params
(
fromList
$
map
(
\
prd
->
(
prd
,
PhyloPeriod
prd
(
initPhyloLevels
(
phyloLevel
conf
)
prd
)))
periods
)
(
fromList
$
map
(
\
prd
->
(
prd
,
PhyloPeriod
prd
(
initPhyloLevels
(
phyloLevel
conf
)
prd
)))
periods
)
src/Gargantext/Viz/Phylo/PhyloTools.hs
View file @
99b5de7d
...
@@ -19,7 +19,7 @@ module Gargantext.Viz.Phylo.PhyloTools where
...
@@ -19,7 +19,7 @@ module Gargantext.Viz.Phylo.PhyloTools where
import
Data.Vector
(
Vector
,
elemIndex
)
import
Data.Vector
(
Vector
,
elemIndex
)
import
Data.List
(
sort
,
concat
,
null
,
union
,
(
++
),
tails
,
sortOn
)
import
Data.List
(
sort
,
concat
,
null
,
union
,
(
++
),
tails
,
sortOn
)
import
Data.Set
(
Set
,
size
)
import
Data.Set
(
Set
,
size
)
import
Data.Map
(
Map
,
elems
,
fromList
,
unionWith
,
keys
,
member
,
(
!
)
,
toList
)
import
Data.Map
(
Map
,
elems
,
fromList
,
unionWith
,
keys
,
member
,
(
!
))
import
Data.String
(
String
)
import
Data.String
(
String
)
import
Gargantext.Prelude
import
Gargantext.Prelude
...
@@ -156,12 +156,12 @@ traceFis msg mFis = trace ( "\n" <> "-- | " <> msg <> " : " <> show (sum $ map l
...
@@ -156,12 +156,12 @@ traceFis msg mFis = trace ( "\n" <> "-- | " <> msg <> " : " <> show (sum $ map l
getFisSupport
::
ContextualUnit
->
Int
getFisSupport
::
ContextualUnit
->
Int
getFisSupport
unit
=
case
unit
of
getFisSupport
unit
=
case
unit
of
Fis
s
_
->
s
Fis
s
_
->
s
_
->
panic
(
"[ERR][Viz.Phylo.PhyloTools.getFisSupport] Only Fis has a support"
)
--
_ -> panic ("[ERR][Viz.Phylo.PhyloTools.getFisSupport] Only Fis has a support")
getFisSize
::
ContextualUnit
->
Int
getFisSize
::
ContextualUnit
->
Int
getFisSize
unit
=
case
unit
of
getFisSize
unit
=
case
unit
of
Fis
_
s
->
s
Fis
_
s
->
s
_
->
panic
(
"[ERR][Viz.Phylo.PhyloTools.getFisSupport] Only Fis has a clique size"
)
--
_ -> panic ("[ERR][Viz.Phylo.PhyloTools.getFisSupport] Only Fis has a clique size")
--------------
--------------
...
@@ -255,10 +255,10 @@ updatePhyloGroups lvl m phylo =
...
@@ -255,10 +255,10 @@ updatePhyloGroups lvl m phylo =
pointersToLinks
::
PhyloGroupId
->
[
Pointer
]
->
[
Link
]
pointersToLinks
::
PhyloGroupId
->
[
Pointer
]
->
[
Link
]
pointersToLinks
id
pointers
=
map
(
\
p
->
((
id
,
fst
p
),
snd
p
))
pointers
pointersToLinks
id
pointers
=
map
(
\
p
->
((
id
,
fst
p
),
snd
p
))
pointers
mergeLinks
::
[
Link
]
->
[
Link
]
->
[
Link
]
--
mergeLinks :: [Link] -> [Link] -> [Link]
mergeLinks
toChilds
toParents
=
--
mergeLinks toChilds toParents =
let
toChilds'
=
fromList
$
map
(
\
((
from
,
to
),
w
)
->
((
to
,
from
),
w
))
toChilds
--
let toChilds' = fromList $ map (\((from,to),w) -> ((to,from),w)) toChilds
in
toList
$
unionWith
max
(
fromList
toParents
)
toChilds'
--
in toList $ unionWith max (fromList toParents) toChilds'
-------------------
-------------------
...
...
src/Gargantext/Viz/Phylo/SynchronicClustering.hs
View file @
99b5de7d
...
@@ -16,8 +16,8 @@ Portability : POSIX
...
@@ -16,8 +16,8 @@ Portability : POSIX
module
Gargantext.Viz.Phylo.SynchronicClustering
where
module
Gargantext.Viz.Phylo.SynchronicClustering
where
import
Gargantext.Prelude
import
Gargantext.Prelude
import
Gargantext.Viz.AdaptativePhylo
--
import Gargantext.Viz.AdaptativePhylo
import
Gargantext.Viz.Phylo.PhyloTools
--
import Gargantext.Viz.Phylo.PhyloTools
import
Data.List
(
foldl'
,
(
++
),
null
,
intersect
,
(
\\
),
union
,
nub
,
concat
)
import
Data.List
(
foldl'
,
(
++
),
null
,
intersect
,
(
\\
),
union
,
nub
,
concat
)
...
...
src/Gargantext/Viz/Phylo/TemporalMatching.hs
View file @
99b5de7d
This diff is collapsed.
Click to expand it.
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