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
195
Issues
195
List
Board
Labels
Milestones
Merge Requests
12
Merge Requests
12
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
6c22e2af
Commit
6c22e2af
authored
Sep 01, 2025
by
Alfredo Di Napoli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tighten log emissions via txLogLocM
parent
673d3d45
Pipeline
#7845
passed with stages
in 59 minutes and 59 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
19 deletions
+19
-19
Ngrams.hs
src/Gargantext/API/Ngrams.hs
+10
-10
New.hs
src/Gargantext/API/Node/Corpus/New.hs
+8
-8
Flow.hs
src/Gargantext/Database/Action/Flow.hs
+1
-1
No files found.
src/Gargantext/API/Ngrams.hs
View file @
6c22e2af
...
...
@@ -22,7 +22,8 @@ add get
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE TupleSections #-}
{-# LANGUAGE TupleSections #-}
{-# LANGUAGE TemplateHaskell #-}
module
Gargantext.API.Ngrams
...
...
@@ -118,6 +119,7 @@ import Gargantext.Database.Action.Metrics.NgramsByContext (getOccByNgramsOnlyFas
import
Gargantext.Database.Prelude
import
Gargantext.Database.Query.Table.Ngrams
(
text2ngrams
,
insertNgrams
)
import
Gargantext.Prelude
hiding
(
log
,
to
,
toLower
,
(
%
),
isInfixOf
)
import
Gargantext.System.Logging.Types
(
LogLevel
(
DEBUG
))
import
Text.Collate
qualified
as
Unicode
...
...
@@ -627,6 +629,7 @@ getNgramsTable' env nId listId ngramsType = do
-- | Helper function to set scores on an `NgramsTable`.
setNgramsTableScores
::
forall
err
t
x
.
(
Each
t
t
NgramsElement
NgramsElement
,
Show
t
)
=>
NodeId
->
ListId
...
...
@@ -637,21 +640,18 @@ setNgramsTableScores nId listId ngramsType table = do
-- FIXME(adn) RESTORE these!
--t1 <- getTime
occurrences
<-
getOccByNgramsOnlyFast
nId
listId
ngramsType
--printDebug "[setNgramsTableScores] occurrences" occurrences
$
(
txLogLocM
)
DEBUG
$
"occurrences: "
<>
T
.
pack
(
show
occurrences
)
--t2 <- getTime
-- let ngrams_terms = table ^.. each . ne_ngrams
-- $(logLocM) DEBUG $ "ngrams_terms: " <> show ngrams_terms
-- $(logLocM) DEBUG $ sformat ("getTableNgrams/setScores #ngrams=" % int % " time=" % hasTime % "\n") (length ngrams_terms) t1 t2
let
setOcc
ne
=
ne
&
ne_occurrences
.~
Set
.
fromList
(
msumOf
(
ix
(
ne
^.
ne_ngrams
))
occurrences
)
let
ngrams_terms
=
table
^..
each
.
ne_ngrams
$
(
txLogLocM
)
DEBUG
$
"ngrams_terms: "
<>
show
ngrams_terms
-- $(txLogLocM) DEBUG $ sformat ("getTableNgrams/setScores #ngrams=" % int % " time=" % hasTime % "\n") (length ngrams_terms) t1 t2
let
setOcc
ne
=
ne
&
ne_occurrences
.~
Set
.
fromList
(
msumOf
(
ix
(
ne
^.
ne_ngrams
))
occurrences
)
--printDebug "[setNgramsTableScores] with occurences" $ table & each %~ setOcc
$
(
txLogLocM
)
DEBUG
$
"with occurences: "
<>
T
.
pack
(
show
$
table
&
each
%~
setOcc
)
pure
$
table
&
each
%~
setOcc
-- APIs
-- TODO: find a better place for the code above, All APIs stay here
...
...
src/Gargantext/API/Node/Corpus/New.hs
View file @
6c22e2af
...
...
@@ -163,15 +163,15 @@ addToCorpusWithQuery user cid (WithQuery { _wq_query = q
,
_wq_datafield
=
datafield
,
_wq_lang
=
l
,
_wq_flowListWith
=
flw
})
maybeLimit
jobHandle
=
do
-- TODO ...
$
(
logLocM
)
DEBUG
$
"[addToCorpusWithQuery] cid "
<>
show
cid
$
(
logLocM
)
DEBUG
$
"[addToCorpusWithQuery] datafield "
<>
show
datafield
$
(
logLocM
)
DEBUG
$
"[addToCorpusWithQuery] flowListWith "
<>
show
flw
runDBTx
$
do
$
(
txLogLocM
)
DEBUG
$
"[addToCorpusWithQuery] cid "
<>
show
cid
$
(
txLogLocM
)
DEBUG
$
"[addToCorpusWithQuery] datafield "
<>
show
datafield
$
(
txLogLocM
)
DEBUG
$
"[addToCorpusWithQuery] flowListWith "
<>
show
flw
$
(
txLogLocM
)
DEBUG
$
"[addToCorpusWithQuery] addLanguageToCorpus "
<>
show
cid
<>
", "
<>
show
l
addLanguageToCorpus
cid
l
$
(
txLogLocM
)
DEBUG
"[addToCorpusWithQuery] after addLanguageToCorpus"
$
(
logLocM
)
DEBUG
$
"[addToCorpusWithQuery] addLanguageToCorpus "
<>
show
cid
<>
", "
<>
show
l
runDBTx
$
addLanguageToCorpus
cid
l
$
(
logLocM
)
DEBUG
"[addToCorpusWithQuery] after addLanguageToCorpus"
case
datafield
of
Web
->
do
$
(
logLocM
)
DEBUG
$
"[addToCorpusWithQuery] processing web request "
<>
show
datafield
...
...
src/Gargantext/Database/Action/Flow.hs
View file @
6c22e2af
...
...
@@ -341,8 +341,8 @@ addDocumentsToHyperCorpus mb_hyper la corpusId docs = do
-- logged, but in the future they could be returned upstream so that we can
-- display a final result of how many were skipped, how many succeded etc.
uncommittedNgrams
<-
extractNgramsFromDocuments
nlp
la
docs
ids
<-
runDBTx
$
insertMasterDocs
cfg
uncommittedNgrams
mb_hyper
docs
runDBTx
$
do
ids
<-
insertMasterDocs
cfg
uncommittedNgrams
mb_hyper
docs
void
$
Doc
.
add
corpusId
(
map
nodeId2ContextId
ids
)
pure
ids
...
...
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