Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
humanities
gargantext
Commits
4283baa5
Commit
4283baa5
authored
May 23, 2016
by
Romain Loth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
FIX add tirank as a separate list type like OCCURRENCES
parent
ab4965ee
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
9 deletions
+15
-9
constants.py
gargantext/constants.py
+10
-5
main.py
gargantext/util/toolchain/main.py
+3
-2
metric_tfidf.py
gargantext/util/toolchain/metric_tfidf.py
+2
-2
No files found.
gargantext/constants.py
View file @
4283baa5
...
...
@@ -13,10 +13,12 @@ LISTTYPES = {
'MAINLIST'
:
UnweightedList
,
'MAPLIST'
:
UnweightedList
,
'SPECIFICITY'
:
WeightedList
,
'OCCURRENCES'
:
WeightedIndex
,
#
todo replace by
WeightedList
'OCCURRENCES'
:
WeightedIndex
,
#
could be
WeightedList
'COOCCURRENCES'
:
WeightedMatrix
,
'TFIDF-CORPUS'
:
WeightedIndex
,
# todo split -> WeightedList for ti_rank and WeightedIndex for tfidf
'TFIDF-GLOBAL'
:
WeightedIndex
,
# todo split -> WeightedList for ti_rank and WeightedIndex for tfidf
'TFIDF-CORPUS'
:
WeightedIndex
,
'TFIDF-GLOBAL'
:
WeightedIndex
,
'TIRANK-LOCAL'
:
WeightedIndex
,
# could be WeightedList
'TIRANK-GLOBAL'
:
WeightedIndex
# could be WeightedList
}
NODETYPES
=
[
...
...
@@ -40,8 +42,11 @@ NODETYPES = [
'TFIDF-CORPUS'
,
# 13
'TFIDF-GLOBAL'
,
# 14
# docs subset
'FAVORITES'
# 15
# TODO add ti RANK
'FAVORITES'
,
# 15
# more scores (sorry!)
'TIRANK-LOCAL'
,
# 16
'TIRANK-GLOBAL'
,
# 17
]
INDEXED_HYPERDATA
=
{
...
...
gargantext/util/toolchain/main.py
View file @
4283baa5
...
...
@@ -112,11 +112,11 @@ def parse_extract_indexhyperdata(corpus):
print
(
'CORPUS #
%
d: [
%
s] new grouplist node #
%
i'
%
(
corpus
.
id
,
t
(),
group_id
))
# ------------
# -> write occurrences to Node and NodeNodeNgram
# (todo: NodeNgram)
# -> write occurrences to Node and NodeNodeNgram
occ_id
=
compute_occs
(
corpus
,
groupings_id
=
group_id
)
print
(
'CORPUS #
%
d: [
%
s] new occs node #
%
i'
%
(
corpus
.
id
,
t
(),
occ_id
))
# -> write cumulated ti_ranking (tfidf ranking vector) to Node and NodeNodeNgram
(todo: NodeNgram)
# -> write cumulated ti_ranking (tfidf ranking vector) to Node and NodeNodeNgram
tirank_id
=
compute_ti_ranking
(
corpus
,
groupings_id
=
group_id
,
count_scope
=
"global"
)
...
...
@@ -172,5 +172,6 @@ def parse_extract_indexhyperdata(corpus):
session
.
commit
()
def
t
():
return
datetime
.
now
()
.
strftime
(
"
%
Y-
%
m-
%
d_
%
H:
%
M:
%
S"
)
gargantext/util/toolchain/metric_tfidf.py
View file @
4283baa5
...
...
@@ -345,11 +345,11 @@ def compute_ti_ranking(corpus,
# create the new TFIDF-XXXX node to get an id
tir_nd
=
corpus
.
add_child
()
if
count_scope
==
"local"
:
tir_nd
.
typename
=
"T
FIDF
-CORPUS"
tir_nd
.
typename
=
"T
IRANK
-CORPUS"
tir_nd
.
name
=
"ti rank (
%
i ngforms in corpus:
%
s)"
%
(
total_ngramforms
,
corpus_id
)
elif
count_scope
==
"global"
:
tir_nd
.
typename
=
"T
FIDF
-GLOBAL"
tir_nd
.
typename
=
"T
IRANK
-GLOBAL"
tir_nd
.
name
=
"ti rank (
%
i ngforms
%
s in corpora of sourcetype:
%
s)"
%
(
total_ngramforms
,
(
"from corpus
%
i"
%
corpus_id
)
if
(
termset_scope
==
"local"
)
else
""
,
...
...
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