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
158
Issues
158
List
Board
Labels
Milestones
Merge Requests
9
Merge Requests
9
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
7a6ec685
Commit
7a6ec685
authored
3 years ago
by
qlobbe
Committed by
Alexandre Delanoë
3 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add default weight
parent
74d2038a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
6 deletions
+11
-6
FrequentItemSet.hs
src/Gargantext/Core/Text/Metrics/FrequentItemSet.hs
+10
-5
PhyloMaker.hs
src/Gargantext/Core/Viz/Phylo/PhyloMaker.hs
+1
-1
No files found.
src/Gargantext/Core/Text/Metrics/FrequentItemSet.hs
View file @
7a6ec685
...
...
@@ -28,7 +28,7 @@ module Gargantext.Core.Text.Metrics.FrequentItemSet
import
Data.List
(
concat
,
null
)
import
Data.Map.Strict
(
Map
)
import
Data.Maybe
(
catMaybes
)
import
Data.Maybe
(
catMaybes
,
isNothing
)
import
Data.Set
(
Set
)
import
Gargantext.Prelude
import
HLCM
...
...
@@ -131,14 +131,19 @@ isSublistOf sub lst = all (\i -> elem i lst) sub
reIndexFis
::
Ord
a
=>
[([
a
],(
b
,
c
))]
->
[
Fis'
a
]
->
[(
Fis'
a
,([
b
],[
c
]))]
reIndexFis
items
fis
=
map
(
\
f
->
let
docs
=
filter
(
\
(
lst
,
_
)
->
isSublistOf
(
_fisItemSet
f
)
lst
)
items
in
(
f
,
(
map
(
fst
.
snd
)
docs
,
map
(
snd
.
snd
)
docs
)))
fis
in
(
f
,
(
map
(
fst
.
snd
)
docs
,
map
(
snd
.
snd
)
docs
)))
fis
wsum
::
[
Maybe
Double
]
->
Maybe
Double
wsum
lst
=
fmap
sum
$
sequence
lst
wsum
::
[
Maybe
Double
]
->
Int
->
Maybe
Double
wsum
lst
sup
=
let
w
=
fmap
sum
$
sequence
lst
in
if
(
isNothing
w
)
then
Just
$
fromIntegral
sup
else
w
fisWithSizePolyMap'
::
Ord
a
=>
Size
->
Frequency
->
[([
a
],
(
Maybe
Double
,[
Int
]))]
->
Map
(
Set
a
)
(
Int
,
(
Maybe
Double
,[
Int
]))
fisWithSizePolyMap'
n
f
is
=
Map
.
fromList
$
map
(
\
(
fis
,(
ws
,
sources
))
->
(
Set
.
fromList
(
_fisItemSet
fis
),(
_fisCount
fis
,(
wsum
ws
,
concat
sources
))))
$
map
(
\
(
fis
,(
ws
,
sources
))
->
(
Set
.
fromList
(
_fisItemSet
fis
),(
_fisCount
fis
,(
wsum
ws
(
_fisCount
fis
)
,
concat
sources
))))
$
reIndexFis
is
$
fisWithSizePoly2
n
f
(
map
fst
is
)
...
...
This diff is collapsed.
Click to expand it.
src/Gargantext/Core/Viz/Phylo/PhyloMaker.hs
View file @
7a6ec685
...
...
@@ -241,7 +241,7 @@ toPhyloClique phylo phyloDocs = case (clique $ getConfig phylo) of
in
(
prd
,
map
(
\
f
->
PhyloClique
(
Set
.
toList
$
fst
f
)
((
fst
.
snd
)
f
)
prd
((
fst
.
snd
.
snd
)
f
)
(((
snd
.
snd
.
snd
)
f
)))
lst
)
_
->
let
lst
=
toList
$
fisWithSizePolyMap
(
Segment
1
20
)
1
(
map
(
\
d
->
ngramsToIdx
(
text
d
)
(
getRoots
phylo
))
docs
)
in
(
prd
,
map
(
\
f
->
PhyloClique
(
Set
.
toList
$
fst
f
)
(
snd
f
)
prd
Nothing
[]
)
lst
)
in
(
prd
,
map
(
\
f
->
PhyloClique
(
Set
.
toList
$
fst
f
)
(
snd
f
)
prd
(
Just
$
fromIntegral
$
snd
f
)
[]
)
lst
)
)
$
toList
phyloDocs
fis'
=
fis
`
using
`
parList
rdeepseq
...
...
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