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
153
Issues
153
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
44ac0efa
Commit
44ac0efa
authored
Mar 08, 2023
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FEAT] Graph O2 bridgeness improvement and FrameWrite Extraction
parent
75b99528
Pipeline
#3741
failed with stage
in 90 minutes and 31 seconds
Changes
4
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
13 deletions
+15
-13
gargantext.cabal
gargantext.cabal
+1
-1
FrameWrite.hs
src/Gargantext/Core/Text/Corpus/Parsers/FrameWrite.hs
+1
-1
Bridgeness.hs
src/Gargantext/Core/Viz/Graph/Bridgeness.hs
+3
-2
Tools.hs
src/Gargantext/Core/Viz/Graph/Tools.hs
+10
-9
No files found.
gargantext.cabal
View file @
44ac0efa
...
...
@@ -5,7 +5,7 @@ cabal-version: 1.12
-- see: https://github.com/sol/hpack
name: gargantext
version: 0.0.6.9.6
version:
0.0.6.9.6
synopsis: Search, map, share
description: Please see README.md
category: Data
...
...
src/Gargantext/Core/Text/Corpus/Parsers/FrameWrite.hs
View file @
44ac0efa
...
...
@@ -238,7 +238,7 @@ text2titleParagraphs n = catMaybes
.
List
.
map
doTitle
.
(
splitEvery
n
)
.
sentences
.
DT
.
intercalate
". "
.
DT
.
intercalate
"
"
-- "
. "
.
List
.
filter
(
/=
""
)
.
DT
.
lines
...
...
src/Gargantext/Core/Viz/Graph/Bridgeness.hs
View file @
44ac0efa
...
...
@@ -115,6 +115,7 @@ data Bridgeness = Bridgeness_Basic { bridgeness_partitions :: [ClusterNode]
}
|
Bridgeness_Recursive
{
br_partitions
::
[[
Set
NodeId
]]
,
br_filter
::
Double
,
br_similarity
::
Similarity
}
...
...
@@ -126,8 +127,8 @@ type Confluence = Map (NodeId, NodeId) Double
bridgeness
::
Bridgeness
->
Map
(
NodeId
,
NodeId
)
Double
->
Map
(
NodeId
,
NodeId
)
Double
bridgeness
(
Bridgeness_Recursive
sn
f
)
m
=
Map
.
unions
$
[
linksBetween
]
<>
map
(
\
s
->
bridgeness
(
Bridgeness_Basic
(
setNodes2clusterNodes
s
)
(
pi
*
f
))
m'
)
sn
bridgeness
(
Bridgeness_Recursive
sn
f
sim
)
m
=
Map
.
unions
$
[
linksBetween
]
<>
map
(
\
s
->
bridgeness
(
Bridgeness_Basic
(
setNodes2clusterNodes
s
)
(
if
sim
==
Conditional
then
pi
*
f
else
f
))
m'
)
sn
where
(
linksBetween
,
m'
)
=
Map
.
partitionWithKey
(
\
(
n1
,
n2
)
_v
->
Map
.
lookup
n1
mapNodeIdClusterId
/=
Map
.
lookup
n2
mapNodeIdClusterId
...
...
src/Gargantext/Core/Viz/Graph/Tools.hs
View file @
44ac0efa
...
...
@@ -25,7 +25,7 @@ import Gargantext.API.Ngrams.Types (NgramsTerm(..))
import
Gargantext.Core.Methods.Similarities
(
Similarity
(
..
),
measure
)
-- import Gargantext.Core.Methods.Similarities.Conditional (conditional)
import
Gargantext.Core.Statistics
import
Gargantext.Core.Viz.Graph.Bridgeness
(
bridgeness
,
Bridgeness
(
..
),
Partitions
,
nodeId2comId
,
recursiveClustering
,
recursiveClustering'
,
setNodes2clusterNodes
)
import
Gargantext.Core.Viz.Graph.Bridgeness
(
bridgeness
,
Bridgeness
(
..
),
Partitions
,
nodeId2comId
{-, recursiveClustering-}
,
recursiveClustering'
,
setNodes2clusterNodes
)
import
Gargantext.Core.Viz.Graph.Index
(
createIndices
,
toIndex
,
map2mat
,
mat2map
,
Index
,
MatrixShape
(
..
))
import
Gargantext.Core.Viz.Graph.Tools.IGraph
(
mkGraphUfromEdges
,
spinglass
,
spinglass'
)
import
Gargantext.Core.Viz.Graph.Tools.Infomap
(
infomap
)
...
...
@@ -132,7 +132,7 @@ cooc2graphWith' _doPartitions _bridgenessMethod multi similarity@Conditional thr
let
!
confluence'
=
BAC
.
computeConfluences
3
(
Map
.
keys
distanceMap
)
True
!
bridgeness'
=
bridgeness
(
Bridgeness_Recursive
partitions
1.0
)
distanceMap
!
bridgeness'
=
bridgeness
(
Bridgeness_Recursive
partitions
1.0
similarity
)
distanceMap
{-
!bridgeness' = if bridgenessMethod == BridgenessMethod_Basic
then bridgeness (Bridgeness_Basic partitions 1.0) distanceMap
...
...
@@ -140,12 +140,13 @@ cooc2graphWith' _doPartitions _bridgenessMethod multi similarity@Conditional thr
-}
pure
$
data2graph
multi
ti
diag
bridgeness'
confluence'
(
setNodes2clusterNodes
$
List
.
concat
partitions
)
cooc2graphWith'
doPartitions
bridgenessMethod
multi
Distributional
threshold
strength
myCooc
=
do
cooc2graphWith'
_doPartitions
_bridgenessMethod
multi
similarity
@
Distributional
threshold
strength
myCooc
=
do
let
(
distanceMap
,
diag
,
ti
)
=
doSimilarityMap
Distributional
threshold
strength
myCooc
distanceMap
`
seq
`
diag
`
seq
`
ti
`
seq
`
return
()
partitions
<-
if
(
Map
.
size
distanceMap
>
0
)
then
recursiveClustering
doPartitions
distanceMap
--then recursiveClustering doPartitions distanceMap
then
recursiveClustering'
(
spinglass'
1
)
distanceMap
else
panic
$
Text
.
unlines
[
"[Gargantext.C.V.Graph.Tools] Similarity Matrix is empty"
,
"Maybe you should add more Map Terms in your list"
,
"Tutorial: TODO"
...
...
@@ -154,14 +155,14 @@ cooc2graphWith' doPartitions bridgenessMethod multi Distributional threshold str
let
!
confluence'
=
BAC
.
computeConfluences
3
(
Map
.
keys
distanceMap
)
True
!
bridgeness'
=
bridgeness
(
Bridgeness_Recursive
partitions
1.0
similarity
)
distanceMap
{-
!bridgeness' = if bridgenessMethod == BridgenessMethod_Basic
then
bridgeness
(
Bridgeness_Basic
partitions
1
0
.0
)
distanceMap
then bridgeness (Bridgeness_Basic partitions 1.0) distanceMap
else bridgeness (Bridgeness_Advanced Distributional confluence') distanceMap
pure $ data2graph multi ti diag bridgeness' confluence' partitions
-}
pure
$
data2graph
multi
ti
diag
bridgeness'
confluence'
(
setNodes2clusterNodes
$
List
.
concat
partitions
)
...
...
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