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
afa9dc7b
Commit
afa9dc7b
authored
Jan 20, 2017
by
delanoe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX] Removing Ok button.
parent
fa610f47
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
6 deletions
+12
-6
main.py
gargantext/util/toolchain/main.py
+1
-1
metric_tfidf.py
gargantext/util/toolchain/metric_tfidf.py
+8
-2
explorer.html
templates/graphExplorer/explorer.html
+3
-3
No files found.
gargantext/util/toolchain/main.py
View file @
afa9dc7b
...
...
@@ -149,7 +149,7 @@ def parse_extract_indexhyperdata(corpus):
on_list_id
=
mainlist_id
,
groupings_id
=
group_id
,
just_pass_result
=
True
,
#
symmetry_filter = True,
symmetry_filter
=
True
,
diagonal_filter
=
False
)
# preserving the diagonal
# (useful for spec/gen)
print
(
'CORPUS #
%
d: [
%
s] computed mainlist coocs for specif rank'
%
(
corpus
.
id
,
t
()))
...
...
gargantext/util/toolchain/metric_tfidf.py
View file @
afa9dc7b
...
...
@@ -16,9 +16,12 @@ from sqlalchemy.sql.expression import case # for choice if ngram has mainform or
from
sqlalchemy
import
distinct
# for list of unique ngram_ids within a corpus
from
math
import
log
from
re
import
match
from
datetime
import
datetime
# £TODO
# from gargantext.util.lists import WeightedIndex
def
t
():
return
datetime
.
now
()
.
strftime
(
"
%
Y-
%
m-
%
d_
%
H:
%
M:
%
S"
)
def
compute_occs
(
corpus
,
overwrite_id
=
None
,
groupings_id
=
None
,):
"""
...
...
@@ -106,7 +109,7 @@ def compute_occs(corpus, overwrite_id = None, groupings_id = None,):
.
group_by
(
"counted_form"
)
)
#print(str(occs_q))
occ_sums
=
occs_q
.
all
()
# example result = [(1970, 1.0), (2024, 2.0), (259, 2.0), (302, 1.0), ... ]
# ^^^^ ^^^
...
...
@@ -325,9 +328,13 @@ def compute_ti_ranking(corpus,
log_tot_docs
=
log
(
total_docs
)
# result
print
(
"
%
s : Starting Query tf_nd_query"
%
t
())
print
(
str
(
tf_nd_query
))
tf_nd
=
tf_nd_query
.
all
()
print
(
"
%
s : End Query tf_nd_quer"
%
t
())
# -------------- "sommatoire" sur mot i ----------------
print
(
"
%
s : tfidfsum"
%
t
())
tfidfsum
=
{}
for
(
ngram_i
,
tf_i
,
nd_i
)
in
tf_nd
:
# tfidfsum[ngram_i] = tf_i * log(total_docs/nd_i)
...
...
@@ -376,7 +383,6 @@ def compute_ti_ranking(corpus,
return
the_id
def
compute_tfidf_local
(
corpus
,
on_list_id
=
None
,
groupings_id
=
None
,
...
...
templates/graphExplorer/explorer.html
View file @
afa9dc7b
...
...
@@ -398,11 +398,11 @@
<div
class=
"modal-body form-horizontal"
>
<div
id=
"msgcontent"
></div>
</div>
<!--
<div class="modal-footer">
<
button
type=
"button"
class=
"btn btn-default"
data-dismiss=
"modal"
>
Ok
</button
>
<
a class="btn btn-default" href="http://gargantext.org" >Ok</a
>
</div>
--!>
</div>
</div>
</div>
...
...
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