Commit 99b5de7d authored by qlobbe's avatar qlobbe

ready for quality score

parent 92b4221b
Pipeline #554 failed with stage
...@@ -87,7 +87,6 @@ data Config = ...@@ -87,7 +87,6 @@ data Config =
, corpusParser :: CorpusParser , corpusParser :: CorpusParser
, phyloName :: Text , phyloName :: Text
, phyloLevel :: Int , phyloLevel :: Int
, phyloQuality :: Double
, phyloProximity :: Proximity , phyloProximity :: Proximity
, timeUnit :: TimeUnit , timeUnit :: TimeUnit
, contextualUnit :: ContextualUnit , contextualUnit :: ContextualUnit
...@@ -103,7 +102,6 @@ defaultConfig = ...@@ -103,7 +102,6 @@ defaultConfig =
, corpusParser = Csv 1000 , corpusParser = Csv 1000
, phyloName = pack "Default Phylo" , phyloName = pack "Default Phylo"
, phyloLevel = 2 , phyloLevel = 2
, phyloQuality = 0.5
, phyloProximity = WeightedLogJaccard 10 0 0.05 , phyloProximity = WeightedLogJaccard 10 0 0.05
, timeUnit = Year 3 1 5 , timeUnit = Year 3 1 5
, contextualUnit = Fis 2 4 , contextualUnit = Fis 2 4
......
...@@ -66,7 +66,7 @@ phyloBase = toPhyloBase docs mapList config ...@@ -66,7 +66,7 @@ phyloBase = toPhyloBase docs mapList config
phyloCooc :: Map Date Cooc phyloCooc :: Map Date Cooc
phyloCooc = docsToTimeScaleCooc docs (foundations ^. foundations_roots) config phyloCooc = docsToTimeScaleCooc docs (foundations ^. foundations_roots)
periods :: [(Date,Date)] periods :: [(Date,Date)]
......
...@@ -173,8 +173,8 @@ ngramsToCooc ngrams coocs = ...@@ -173,8 +173,8 @@ ngramsToCooc ngrams coocs =
-- | To transform the docs into a time map of coocurency matrix -- | To transform the docs into a time map of coocurency matrix
docsToTimeScaleCooc :: [Document] -> Vector Ngrams -> Config -> Map Date Cooc docsToTimeScaleCooc :: [Document] -> Vector Ngrams -> Map Date Cooc
docsToTimeScaleCooc docs fdt conf = docsToTimeScaleCooc docs fdt =
let mCooc = fromListWith sumCooc let mCooc = fromListWith sumCooc
$ map (\(_d,l) -> (_d, listToMatrix l)) $ map (\(_d,l) -> (_d, listToMatrix l))
$ map (\doc -> (date doc, sort $ ngramsToIdx (text doc) fdt)) docs $ map (\doc -> (date doc, sort $ ngramsToIdx (text doc) fdt)) docs
...@@ -229,7 +229,7 @@ toPhyloBase docs lst conf = ...@@ -229,7 +229,7 @@ toPhyloBase docs lst conf =
periods = toPeriods (sort $ nub $ map date docs) (getTimePeriod $ timeUnit conf) (getTimeStep $ timeUnit conf) periods = toPeriods (sort $ nub $ map date docs) (getTimePeriod $ timeUnit conf) (getTimeStep $ timeUnit conf)
in trace ("\n" <> "-- | Create PhyloBase out of " <> show(length docs) <> " docs \n") in trace ("\n" <> "-- | Create PhyloBase out of " <> show(length docs) <> " docs \n")
$ Phylo foundations $ Phylo foundations
(docsToTimeScaleCooc docs (foundations ^. foundations_roots) conf) (docsToTimeScaleCooc docs (foundations ^. foundations_roots))
(docsToTimeScaleNb docs) (docsToTimeScaleNb docs)
params params
(fromList $ map (\prd -> (prd, PhyloPeriod prd (initPhyloLevels (phyloLevel conf) prd))) periods) (fromList $ map (\prd -> (prd, PhyloPeriod prd (initPhyloLevels (phyloLevel conf) prd))) periods)
...@@ -19,7 +19,7 @@ module Gargantext.Viz.Phylo.PhyloTools where ...@@ -19,7 +19,7 @@ module Gargantext.Viz.Phylo.PhyloTools where
import Data.Vector (Vector, elemIndex) import Data.Vector (Vector, elemIndex)
import Data.List (sort, concat, null, union, (++), tails, sortOn) import Data.List (sort, concat, null, union, (++), tails, sortOn)
import Data.Set (Set, size) import Data.Set (Set, size)
import Data.Map (Map, elems, fromList, unionWith, keys, member, (!), toList) import Data.Map (Map, elems, fromList, unionWith, keys, member, (!))
import Data.String (String) import Data.String (String)
import Gargantext.Prelude import Gargantext.Prelude
...@@ -156,12 +156,12 @@ traceFis msg mFis = trace ( "\n" <> "-- | " <> msg <> " : " <> show (sum $ map l ...@@ -156,12 +156,12 @@ traceFis msg mFis = trace ( "\n" <> "-- | " <> msg <> " : " <> show (sum $ map l
getFisSupport :: ContextualUnit -> Int getFisSupport :: ContextualUnit -> Int
getFisSupport unit = case unit of getFisSupport unit = case unit of
Fis s _ -> s Fis s _ -> s
_ -> panic ("[ERR][Viz.Phylo.PhyloTools.getFisSupport] Only Fis has a support") -- _ -> panic ("[ERR][Viz.Phylo.PhyloTools.getFisSupport] Only Fis has a support")
getFisSize :: ContextualUnit -> Int getFisSize :: ContextualUnit -> Int
getFisSize unit = case unit of getFisSize unit = case unit of
Fis _ s -> s Fis _ s -> s
_ -> panic ("[ERR][Viz.Phylo.PhyloTools.getFisSupport] Only Fis has a clique size") -- _ -> panic ("[ERR][Viz.Phylo.PhyloTools.getFisSupport] Only Fis has a clique size")
-------------- --------------
...@@ -255,10 +255,10 @@ updatePhyloGroups lvl m phylo = ...@@ -255,10 +255,10 @@ updatePhyloGroups lvl m phylo =
pointersToLinks :: PhyloGroupId -> [Pointer] -> [Link] pointersToLinks :: PhyloGroupId -> [Pointer] -> [Link]
pointersToLinks id pointers = map (\p -> ((id,fst p),snd p)) pointers pointersToLinks id pointers = map (\p -> ((id,fst p),snd p)) pointers
mergeLinks :: [Link] -> [Link] -> [Link] -- mergeLinks :: [Link] -> [Link] -> [Link]
mergeLinks toChilds toParents = -- mergeLinks toChilds toParents =
let toChilds' = fromList $ map (\((from,to),w) -> ((to,from),w)) toChilds -- let toChilds' = fromList $ map (\((from,to),w) -> ((to,from),w)) toChilds
in toList $ unionWith max (fromList toParents) toChilds' -- in toList $ unionWith max (fromList toParents) toChilds'
------------------- -------------------
......
...@@ -16,8 +16,8 @@ Portability : POSIX ...@@ -16,8 +16,8 @@ Portability : POSIX
module Gargantext.Viz.Phylo.SynchronicClustering where module Gargantext.Viz.Phylo.SynchronicClustering where
import Gargantext.Prelude import Gargantext.Prelude
import Gargantext.Viz.AdaptativePhylo -- import Gargantext.Viz.AdaptativePhylo
import Gargantext.Viz.Phylo.PhyloTools -- import Gargantext.Viz.Phylo.PhyloTools
import Data.List (foldl', (++), null, intersect, (\\), union, nub, concat) import Data.List (foldl', (++), null, intersect, (\\), union, nub, concat)
......
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