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
11
Merge Requests
11
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
c092568a
Commit
c092568a
authored
Feb 04, 2021
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PARAM] List cut of Candidate Ngrams
parent
336815f4
Pipeline
#1400
failed with stage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
24 deletions
+28
-24
List.hs
src/Gargantext/Core/Text/List.hs
+28
-24
No files found.
src/Gargantext/Core/Text/List.hs
View file @
c092568a
...
...
@@ -144,7 +144,7 @@ getGroupParams :: ( HasNodeError err
=>
GroupParams
->
HashSet
Ngrams
->
m
GroupParams
getGroupParams
gp
@
(
GroupWithPosTag
l
a
_m
)
ng
=
do
hashMap
<-
HashMap
.
fromList
<$>
selectLems
l
a
(
HashSet
.
toList
ng
)
printDebug
"hashMap"
hashMap
--
printDebug "hashMap" hashMap
pure
$
over
gwl_map
(
\
x
->
x
<>
hashMap
)
gp
getGroupParams
gp
_
=
pure
gp
...
...
@@ -201,8 +201,8 @@ buildNgramsTermsList user uCid mCid groupParams (nt, _mapListSize)= do
$
List
.
sortOn
(
viewScore
.
snd
)
$
HashMap
.
toList
ns
(
groupedMonoHead
,
groupedMonoTail
)
=
splitAt
monoSize
groupedMono
(
groupedMultHead
,
groupedMultTail
)
=
splitAt
multSize
groupedMult
(
groupedMonoHead
,
_
groupedMonoTail
)
=
splitAt
monoSize
groupedMono
(
groupedMultHead
,
groupedMultTail
)
=
splitAt
multSize
groupedMult
-------------------------
-- Filter 1 With Set NodeId and SpeGen
...
...
@@ -276,8 +276,8 @@ buildNgramsTermsList user uCid mCid groupParams (nt, _mapListSize)= do
monoInc_size
=
splitAt'
$
monoSize
*
inclSize
/
2
(
monoScoredInclHead
,
monoScoredInclTail
)
=
monoInc_size
$
(
sortOn
scored_genInc
)
monoScoredIncl
(
monoScoredExclHead
,
monoScoredExclTail
)
=
monoInc_size
$
(
sortOn
scored_speExc
)
monoScoredExcl
(
monoScoredInclHead
,
_
monoScoredInclTail
)
=
monoInc_size
$
(
sortOn
scored_genInc
)
monoScoredIncl
(
monoScoredExclHead
,
_
monoScoredExclTail
)
=
monoInc_size
$
(
sortOn
scored_speExc
)
monoScoredExcl
multExc_size
=
splitAt'
$
multSize
*
exclSize
/
2
(
multScoredInclHead
,
multScoredInclTail
)
=
multExc_size
$
(
sortOn
scored_genInc
)
multScoredIncl
...
...
@@ -285,25 +285,29 @@ buildNgramsTermsList user uCid mCid groupParams (nt, _mapListSize)= do
------------------------------------------------------------
-- Final Step building the Typed list
termListHead
=
maps
<>
cands
where
maps
=
setListType
(
Just
MapTerm
)
$
monoScoredInclHead
<>
monoScoredExclHead
<>
multScoredInclHead
<>
multScoredExclHead
cands
=
setListType
(
Just
CandidateTerm
)
$
monoScoredInclTail
<>
monoScoredExclTail
<>
multScoredInclTail
<>
multScoredExclTail
termListTail
=
(
setListType
(
Just
CandidateTerm
))
(
groupedMonoTail
<>
groupedMultTail
)
let
result
=
Map
.
unionsWith
(
<>
)
[
Map
.
fromList
[(
nt
,
toNgramsElement
termListHead
<>
toNgramsElement
termListTail
-- Candidates Terms need to be filtered
let
maps
=
setListType
(
Just
MapTerm
)
$
monoScoredInclHead
<>
monoScoredExclHead
<>
multScoredInclHead
<>
multScoredExclHead
-- An original way to filter to start with
cands
=
setListType
(
Just
CandidateTerm
)
$
{- monoScoredInclTail
<> monoScoredExclTail
<> -}
multScoredInclTail
<>
multScoredExclTail
cands'
=
setListType
(
Just
CandidateTerm
)
{-$ groupedMonoTail
<>-}
groupedMultTail
result
=
Map
.
unionsWith
(
<>
)
[
Map
.
fromList
[(
nt
,
toNgramsElement
maps
<>
toNgramsElement
cands
<>
toNgramsElement
cands'
<>
toNgramsElement
stopTerms
)]
]
...
...
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