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
4f2a2f3f
Commit
4f2a2f3f
authored
Jul 22, 2016
by
Romain Loth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[minor] clarify call to query_grouped_ngrams removing the deprecated parts
parent
e6e627fa
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
13 deletions
+3
-13
group_tools.py
gargantext/util/group_tools.py
+2
-11
ngramlists.py
gargantext/views/api/ngramlists.py
+1
-2
No files found.
gargantext/util/group_tools.py
View file @
4f2a2f3f
...
...
@@ -48,28 +48,19 @@ def query_grouped_ngrams(groupings_id, details=False, scoring_metric_id=None):
Parameter:
- details: if False, send just the array of ngram_ids
if True, send triples with (ngram_id, term, scoring)
^^^^^^^
deprecated: scoring_metric_id: id of a scoring metric node (TFIDF or OCCS)
(for details and sorting)
(no more OCCS counts of subforms)
if True, send couples with (ngram_id, term)
"""
if
not
details
:
# simple contents
query
=
session
.
query
(
NodeNgramNgram
.
ngram2_id
)
else
:
# detailed contents (
terms and some NodeNodeNgram for score
)
# detailed contents (
id + terms
)
query
=
(
session
.
query
(
NodeNgramNgram
.
ngram2_id
,
Ngram
.
terms
,
# NodeNodeNgram.score #
)
.
join
(
Ngram
,
NodeNgramNgram
.
ngram2_id
==
Ngram
.
id
)
# .join(NodeNodeNgram, NodeNgramNgram.ngram2_id == NodeNodeNgram.ngram_id)
# .filter(NodeNodeNgram.node1_id == scoring_metric_id)
# .order_by(desc(NodeNodeNgram.score))
)
# main filter
...
...
gargantext/views/api/ngramlists.py
View file @
4f2a2f3f
...
...
@@ -614,8 +614,7 @@ class ListFamily(APIView):
mainlist_query
=
query_list
(
mainlist_id
,
details
=
True
,
scoring_metric_id
=
scores_id
)
# infos for grouped ngrams, absent from mainlist
hidden_ngrams_query
=
query_grouped_ngrams
(
groups_id
,
details
=
True
,
scoring_metric_id
=
scores_id
)
hidden_ngrams_query
=
query_grouped_ngrams
(
groups_id
,
details
=
True
)
# infos for stoplist terms, absent from mainlist
stop_ngrams_query
=
query_list
(
other_list_ids
[
'stoplist'
],
details
=
True
,
...
...
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