Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
Przemyslaw Kaminski
haskell-gargantext
Commits
47ab0d5b
Commit
47ab0d5b
authored
Jan 21, 2021
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[OPTIM] Insert ngrams
parent
4d140947
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
10 deletions
+7
-10
Flow.hs
src/Gargantext/Database/Action/Flow.hs
+7
-10
No files found.
src/Gargantext/Database/Action/Flow.hs
View file @
47ab0d5b
...
@@ -448,19 +448,20 @@ indexAllDocumentsWithPosTag = do
...
@@ -448,19 +448,20 @@ indexAllDocumentsWithPosTag = do
corpusIds
<-
findNodesId
rootId
[
NodeCorpus
]
corpusIds
<-
findNodesId
rootId
[
NodeCorpus
]
docs
<-
List
.
concat
<$>
mapM
getDocumentsWithParentId
corpusIds
docs
<-
List
.
concat
<$>
mapM
getDocumentsWithParentId
corpusIds
printDebug
"Nb of docs"
(
List
.
length
docs
)
_
<-
mapM
extractInsert
(
splitEvery
1000
docs
)
pure
()
extractInsert
::
FlowCmdM
env
err
m
=>
[
Node
HyperdataDocument
]
->
m
()
extractInsert
docs
=
do
let
documentsWithId
=
map
(
\
doc
->
Indexed
(
doc
^.
node_id
)
doc
)
docs
let
documentsWithId
=
map
(
\
doc
->
Indexed
(
doc
^.
node_id
)
doc
)
docs
mapNgramsDocs'
::
HashMap
ExtractedNgrams
(
Map
NgramsType
(
Map
NodeId
Int
))
mapNgramsDocs'
<-
mapNodeIdNgrams
<-
mapNodeIdNgrams
<$>
documentIdWithNgrams
<$>
documentIdWithNgrams
(
extractNgramsT
$
withLang
(
Multi
EN
)
documentsWithId
)
(
extractNgramsT
$
withLang
(
Multi
EN
)
documentsWithId
)
documentsWithId
documentsWithId
_
<-
mapM
insertExtractedNgrams
_
<-
insertExtractedNgrams
$
HashMap
.
keys
mapNgramsDocs'
$
splitEvery
500
$
HashMap
.
keys
mapNgramsDocs'
pure
()
pure
()
...
@@ -471,7 +472,3 @@ indexAllDocumentsWithPosTag = do
...
@@ -471,7 +472,3 @@ indexAllDocumentsWithPosTag = do
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