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
1f76b796
Commit
1f76b796
authored
Jul 05, 2016
by
delanoe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FEAT] Tests options.
parent
a1565646
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
1 deletion
+21
-1
cooccurrences.py
graphExplorer/cooccurrences.py
+1
-1
graph.py
graphExplorer/graph.py
+20
-0
No files found.
graphExplorer/cooccurrences.py
View file @
1f76b796
...
@@ -17,7 +17,7 @@ def filterMatrix(matrix, mapList_id, groupList_id):
...
@@ -17,7 +17,7 @@ def filterMatrix(matrix, mapList_id, groupList_id):
return
cooc
return
cooc
def
countCooccurrences
(
corpus
=
None
def
countCooccurrences
(
corpus
=
None
,
test
=
False
,
field1
=
'ngrams'
,
field2
=
'ngrams'
,
field1
=
'ngrams'
,
field2
=
'ngrams'
,
start
=
None
,
end
=
None
,
start
=
None
,
end
=
None
,
mapList_id
=
None
,
groupList_id
=
None
,
mapList_id
=
None
,
groupList_id
=
None
...
...
graphExplorer/graph.py
View file @
1f76b796
...
@@ -23,6 +23,7 @@ import networkx as nx
...
@@ -23,6 +23,7 @@ import networkx as nx
def
get_graph
(
request
=
None
,
corpus
=
None
def
get_graph
(
request
=
None
,
corpus
=
None
,
test
=
False
,
field1
=
'ngrams'
,
field2
=
'ngrams'
,
field1
=
'ngrams'
,
field2
=
'ngrams'
,
mapList_id
=
None
,
groupList_id
=
None
,
mapList_id
=
None
,
groupList_id
=
None
,
cooc_id
=
None
,
type
=
'node_link'
,
cooc_id
=
None
,
type
=
'node_link'
...
@@ -67,6 +68,25 @@ def get_graph( request=None , corpus=None
...
@@ -67,6 +68,25 @@ def get_graph( request=None , corpus=None
,
save_on_db
=
True
,
save_on_db
=
True
#, limit=size
#, limit=size
)
)
if
test
=
True
:
cooc_matrix
=
countCooccurrences
(
corpus
=
corpus
,
test
=
test
#, field1="ngrams", field2="ngrams"
,
start
=
start
,
end
=
end
,
mapList_id
=
mapList_id
,
groupList_id
=
groupList_id
,
isMonopartite
=
True
,
threshold
=
threshold
,
save_on_db
=
True
#, limit=size
)
else
:
cooc_matrix
=
countCooccurrences
(
corpus
=
corpus
,
test
=
test
#, field1="ngrams", field2="ngrams"
,
start
=
start
,
end
=
end
,
mapList_id
=
mapList_id
,
groupList_id
=
groupList_id
,
isMonopartite
=
True
,
threshold
=
threshold
,
save_on_db
=
True
#, limit=size
)
else
:
else
:
print
(
"Getting data for matrix
%
d"
,
int
(
cooc_id
))
print
(
"Getting data for matrix
%
d"
,
int
(
cooc_id
))
matrix
=
WeightedMatrix
(
int
(
cooc_id
))
matrix
=
WeightedMatrix
(
int
(
cooc_id
))
...
...
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