Commit 4ef15dd7 authored by Alexandre Delanoë's avatar Alexandre Delanoë

[TextFlow] WIP Metrics fixes

parent 38ca4c31
......@@ -141,14 +141,11 @@ buildNgramsTermsList :: Lang
-> Cmd err (Map NgramsType [NgramsElement])
buildNgramsTermsList _l _n _m s uCid mCid = do
candidates <- sortTficf Down <$> getTficf uCid mCid NgramsTerms
printDebug "candidates" (length candidates)
printDebug "head candidates" (List.take 10 $ candidates)
printDebug "tail candidates" (List.take 10 $ List.reverse $ candidates)
let
candidatesSize = 400
{-
a = 50
b = 50
-}
candidatesHead = List.take candidatesSize candidates
candidatesTail = List.drop candidatesSize candidates
......
......@@ -47,7 +47,7 @@ tficf :: TficfContext Count Total
-> TFICF
tficf (TficfInfra (Count ic) (Total it) )
(TficfSupra (Count sc) (Total st) )
| it >= ic && st >= sc && it <= st = (ic/it) / log (sc/st)
| it >= ic && st >= sc && it <= st = (it/ic) * log (st/sc)
| otherwise = panic $ "[ERR]" <> path <>" Frequency impossible"
tficf _ _ = panic $ "[ERR]" <> path <> "Undefined for these contexts"
......
......@@ -238,7 +238,7 @@ insertDocs :: ( FlowCmdM env err m
insertDocs uId cId hs = do
let docs = map addUniqId hs
newIds <- insertDb uId cId docs
printDebug "newIds" newIds
-- printDebug "newIds" newIds
let
newIds' = map reId newIds
documentsWithId = mergeData (toInserted newIds) (Map.fromList $ map viewUniqId' docs)
......
......@@ -34,8 +34,8 @@ getTficf :: UserCorpusId
-> NgramsType
-> Cmd err (Map Text Double)
getTficf cId mId nt = do
mapTextDoubleLocal <- {- Map.filter (> 1)
<$> -} Map.map (fromIntegral . Set.size)
mapTextDoubleLocal <- Map.filter (> 1)
<$> Map.map (fromIntegral . Set.size)
<$> getNodesByNgramsUser cId nt
mapTextDoubleGlobal <- Map.map fromIntegral
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment