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
ef4ecd5a
Commit
ef4ecd5a
authored
Oct 08, 2015
by
delanoe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX] Group asymetrics and graph parameters: note, too many specific nodes at this stage.
parent
a74861c5
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
6 deletions
+7
-6
cooccurrences.py
analysis/cooccurrences.py
+1
-1
functions.py
analysis/functions.py
+2
-2
group.py
ngram/group.py
+3
-2
workflow.py
ngram/workflow.py
+1
-1
No files found.
analysis/cooccurrences.py
View file @
ef4ecd5a
...
@@ -57,7 +57,7 @@ def cooc(corpus=None
...
@@ -57,7 +57,7 @@ def cooc(corpus=None
doc_id
=
cache
.
NodeType
[
'Document'
]
.
id
doc_id
=
cache
.
NodeType
[
'Document'
]
.
id
cooc_query
=
(
session
.
query
(
NodeNgramX
.
ngram_id
,
NodeNgramY
.
ngram_id
,
cooc_query
=
(
session
.
query
(
NodeNgramX
.
ngram_id
,
NodeNgramY
.
ngram_id
,
func
.
sqrt
(
func
.
sum
(
NodeNgram
.
weight
)
*
func
.
sum
(
NodeNgraY
.
wei
)))
func
.
sqrt
(
func
.
sum
(
NodeNgram
X
.
weight
)
*
func
.
sum
(
NodeNgramY
.
weight
)))
.
join
(
Node
,
Node
.
id
==
NodeNgramX
.
node_id
)
.
join
(
Node
,
Node
.
id
==
NodeNgramX
.
node_id
)
.
join
(
NodeNgramY
,
NodeNgramY
.
node_id
==
Node
.
id
)
.
join
(
NodeNgramY
,
NodeNgramY
.
node_id
==
Node
.
id
)
.
filter
(
Node
.
parent_id
==
corpus
.
id
,
Node
.
type_id
==
doc_id
)
.
filter
(
Node
.
parent_id
==
corpus
.
id
,
Node
.
type_id
==
doc_id
)
...
...
analysis/functions.py
View file @
ef4ecd5a
...
@@ -229,10 +229,10 @@ def get_cooc(request=None, corpus=None, cooc_id=None, type='node_link', size=siz
...
@@ -229,10 +229,10 @@ def get_cooc(request=None, corpus=None, cooc_id=None, type='node_link', size=siz
#print(n)
#print(n)
#print(m)
#print(m)
nodes_included
=
3
00
#int(round(size/20,0))
nodes_included
=
3
33
#int(round(size/20,0))
#nodes_excluded = int(round(size/10,0))
#nodes_excluded = int(round(size/10,0))
nodes_specific
=
3
00
#int(round(size/10,0))
nodes_specific
=
3
33
#int(round(size/10,0))
#nodes_generic = int(round(size/10,0))
#nodes_generic = int(round(size/10,0))
# TODO user the included score for the node size
# TODO user the included score for the node size
...
...
ngram/group.py
View file @
ef4ecd5a
...
@@ -137,9 +137,10 @@ def compute_groups(corpus, limit_inf=None, limit_sup=None, how='Stem'):
...
@@ -137,9 +137,10 @@ def compute_groups(corpus, limit_inf=None, limit_sup=None, how='Stem'):
miam_to_insert
.
add
((
miam_node
.
id
,
n
[
0
],
1
))
miam_to_insert
.
add
((
miam_node
.
id
,
n
[
0
],
1
))
#print([n for n in group])
#print([n for n in group])
for
g
in
group
:
for
g
in
group
:
if
(
miam_node
.
id
,
g
[
0
],
1
)
not
in
miam_to_insert
:
#list_to_check.remove(g)
#list_to_check.remove(g)
group_to_insert
.
append
((
node_group
.
id
,
n
[
0
],
g
[
0
],
1
))
group_to_insert
.
append
((
node_group
.
id
,
n
[
0
],
g
[
0
],
1
))
print
(
n
[
1
],
"="
,
g
[
1
])
print
(
n
[
1
],
"="
,
g
[
1
])
# Deleting previous groups
# Deleting previous groups
session
.
query
(
NodeNgramNgram
)
.
filter
(
NodeNgramNgram
.
node_id
==
node_group
.
id
)
.
delete
()
session
.
query
(
NodeNgramNgram
)
.
filter
(
NodeNgramNgram
.
node_id
==
node_group
.
id
)
.
delete
()
...
...
ngram/workflow.py
View file @
ef4ecd5a
...
@@ -26,7 +26,7 @@ def ngram_workflow(corpus, n=5000):
...
@@ -26,7 +26,7 @@ def ngram_workflow(corpus, n=5000):
# compute_stop(corpus)
# compute_stop(corpus)
compute_groups
(
corpus
,
limit_inf
=
part
,
limit_sup
=
n
)
compute_groups
(
corpus
,
limit_inf
=
part
,
limit_sup
=
n
)
compute_miam
(
corpus
,
limit
=
part
)
# size
#
compute_miam(corpus,limit=part) # size
compute_tfidf
(
corpus
)
compute_tfidf
(
corpus
)
...
...
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