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
fc806c34
Commit
fc806c34
authored
Jun 07, 2019
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[VETODO] Entropy Variation fixed on test, needs now to be implemented in the Getting Lens function.
parent
7835e973
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
Eleve.hs
src/Gargantext/Text/Eleve.hs
+6
-4
No files found.
src/Gargantext/Text/Eleve.hs
View file @
fc806c34
...
...
@@ -44,7 +44,7 @@ module Gargantext.Text.Eleve where
import
Debug.Trace
(
trace
)
-- import Debug.SimpleReflect
import
Control.Lens
(
Lens
'
,
Getting
,
(
^.
),
(
^?
),
view
,
makeLenses
,
_Just
)
import
Control.Lens
(
Lens
'
,
Getting
,
(
^.
),
(
^?
),
view
,
makeLenses
,
_Just
,
under
,
reversed
)
import
Control.Monad
(
forM_
)
import
Data.Ord
(
Ord
)
import
qualified
Data.List
as
L
...
...
@@ -283,6 +283,8 @@ instance IsTrie Tries where
}
nodeEntropy
inE
(
Tries
fwd
bwd
)
=
-- VETODO reverse the query for bwd here
-- mean $ noNaNs [nodeEntropy inE fwd, nodeEntropy inE bwd . under reversed]
mean
$
noNaNs
[
nodeEntropy
inE
fwd
,
nodeEntropy
inE
bwd
]
findTrie
ks
(
Tries
fwd
bwd
)
=
Tries
(
findTrie
ks
fwd
)
(
findTrie
ks
bwd
)
...
...
@@ -410,12 +412,12 @@ testEleve debug n output checks = do
t'
=
findTrie
ns
nt
nsb
=
parseToken
<$>
(
reverse
$
T
.
words
ngram
)
tb'
=
findTrie
nsb
nt
-- TODO put this Variation Entropy at VETODO mark above
ev
=
(
mean
[(
nodeEntropy
info_entropy
(
_fwd
t'
)),
(
nodeEntropy
info_entropy
(
_bwd
tb'
))])
P
.
putStrLn
$
" "
<>
T
.
unpack
ngram
<>
":"
check
(
==
)
"count"
count
(
_node_count
(
_fwd
t'
))
check
sim
"entropy"
entropy
(
mean
[(
nodeEntropy
info_entropy
(
_fwd
t'
)),
(
nodeEntropy
info_entropy
(
_bwd
tb'
))])
-- (nodeEntropy info_entropy t')
check
sim
"entropy"
entropy
ev
check
sim
"autonomy"
autonomy
(
nodeEntropy
info_autonomy
t'
)
check
sim
"fwd_entropy"
fwd_entropy
(
nodeEntropy
info_entropy
(
_fwd
t'
))
check
sim
"bwd_entropy"
bwd_entropy
(
nodeEntropy
info_entropy
(
_bwd
t'
))
...
...
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