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
67c34520
Commit
67c34520
authored
May 26, 2021
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[LIST] improved for candidates
parent
65f36dec
Pipeline
#1468
failed with stage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
18 deletions
+26
-18
List.hs
src/Gargantext/Core/Text/List.hs
+26
-18
No files found.
src/Gargantext/Core/Text/List.hs
View file @
67c34520
...
...
@@ -256,42 +256,50 @@ buildNgramsTermsList user uCid mCid groupParams (nt, _mapListSize)= do
-- splitAt
let
-- use % of list if to big, or Int if to small
listSizeLocal
=
1000
::
Double
mapSize
=
1000
::
Double
canSize
=
mapSize
*
10
::
Double
inclSize
=
0.4
::
Double
exclSize
=
1
-
inclSize
splitAt'
max'
n'
=
(
both
(
HashMap
.
fromList
))
.
(
List
.
splitAt
(
round
$
n'
*
max'
))
sortOn
f
=
(
List
.
sortOn
(
Down
.
(
view
(
gts'_score
.
f
))
.
snd
))
.
HashMap
.
toList
monoInc_size
n
=
splitAt'
n
$
monoSize
*
inclSize
/
2
multExc_size
n
=
splitAt'
n
$
multSize
*
exclSize
/
2
(
mapMonoScoredInclHead
,
monoScoredInclTail
)
=
monoInc_size
mapSize
$
(
sortOn
scored_genInc
)
monoScoredIncl
(
mapMonoScoredExclHead
,
monoScoredExclTail
)
=
monoInc_size
mapSize
$
(
sortOn
scored_speExc
)
monoScoredExcl
(
mapMultScoredInclHead
,
multScoredInclTail
)
=
multExc_size
mapSize
$
(
sortOn
scored_genInc
)
multScoredIncl
(
mapMultScoredExclHead
,
multScoredExclTail
)
=
multExc_size
mapSize
$
(
sortOn
scored_speExc
)
multScoredExcl
monoInc_size
=
splitAt'
listSizeLocal
$
monoSize
*
inclSize
/
2
(
monoScoredInclHead
,
monoScoredInclTail
)
=
monoInc_size
$
(
sortOn
scored_genInc
)
monoScoredIncl
(
monoScoredExclHead
,
_monoScoredExclTail
)
=
monoInc_size
$
(
sortOn
scored_speExc
)
monoScoredExcl
multExc_size
=
splitAt'
listSizeLocal
$
multSize
*
exclSize
/
2
(
multScoredInclHead
,
multScoredInclTail
)
=
multExc_size
$
(
sortOn
scored_genInc
)
multScoredIncl
(
multScoredExclHead
,
multScoredExclTail
)
=
multExc_size
$
(
sortOn
scored_speExc
)
multScoredExcl
(
canMonoScoredIncHead
,
_
)
=
monoInc_size
canSize
$
(
sortOn
scored_genInc
)
monoScoredInclTail
(
canMonoScoredExclHead
,
_
)
=
monoInc_size
canSize
$
(
sortOn
scored_speExc
)
monoScoredExclTail
(
candidatesHead
,
_candidatesTail
)
=
splitAt'
4000
(
0.5
::
Double
)
$
sortOn
scored_genInc
$
monoScoredInclTail
<>
multScoredInclTail
<>
multScoredExclTail
printDebug
"stopWords"
stopTerms
(
canMulScoredInclHead
,
_
)
=
multExc_size
canSize
$
(
sortOn
scored_genInc
)
multScoredInclTail
(
canMultScoredExclHead
,
_
)
=
multExc_size
canSize
$
(
sortOn
scored_speExc
)
multScoredExclTail
------------------------------------------------------------
-- Final Step building the Typed list
-- Candidates Terms need to be filtered
let
maps
=
setListType
(
Just
MapTerm
)
$
monoScoredInclHead
<>
monoScoredExclHead
<>
multScoredInclHead
<>
multScoredExclHead
$
m
apM
onoScoredInclHead
<>
m
apM
onoScoredExclHead
<>
m
apM
ultScoredInclHead
<>
m
apM
ultScoredExclHead
-- An original way to filter to start with
cands
=
setListType
(
Just
CandidateTerm
)
candidatesHead
cands
=
setListType
(
Just
CandidateTerm
)
$
canMonoScoredIncHead
<>
canMonoScoredExclHead
<>
canMulScoredInclHead
<>
canMultScoredExclHead
-- TODO count it too
cands'
=
setListType
(
Just
CandidateTerm
)
{-$ groupedMonoTail
<>-}
groupedMultTail
...
...
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