Commit b09df773 authored by Mathieu Rodic's avatar Mathieu Rodic

[GIT] Merged conflicts with master

parent e5c57cba
__pycache__/
parsing/Taggers/treetagger/
.ipynb_checkpoints/
<<<<<<< HEAD
*.pyc
=======
data_samples
VENV
>>>>>>> master
......@@ -69,11 +69,7 @@ def create_whitelist(user, corpus, size=100):
return white_list
#def create_cooc(user, corpus, whitelist, blacklist, synonymes):
<<<<<<< HEAD
def create_cooc(user=None, corpus=None, whitelist=None, size=150):
=======
def create_cooc(user=None, corpus=None, whitelist=None, size=150, year_start=None, year_end=None):
>>>>>>> master
cursor = connection.cursor()
try:
......@@ -137,11 +133,7 @@ def create_cooc(user=None, corpus=None, whitelist=None, size=150, year_start=Non
cursor.execute(query_cooc)
return cooc
<<<<<<< HEAD
def get_cooc(request=None, corpus_id=None, cooc_id=None, type="node_link"):
=======
def get_cooc(request=None, corpus_id=None, cooc_id=None, type=None, n=150):
>>>>>>> master
import pandas as pd
from copy import copy
import numpy as np
......@@ -160,14 +152,6 @@ def get_cooc(request=None, corpus_id=None, cooc_id=None, type=None, n=150):
if Node.objects.filter(type=type_cooc, parent=corpus).first() is None:
print("Coocurrences do not exist yet, create it.")
<<<<<<< HEAD
if type == "node_link":
n = 150
elif type == "adjacency":
n = 50
=======
>>>>>>> master
whitelist = create_whitelist(request.user, corpus, size=n)
cooccurrence_node = create_cooc(user=request.user, corpus=corpus, whitelist=whitelist, size=n)
print(cooccurrence_node.id, "Cooc created")
......@@ -185,11 +169,7 @@ def get_cooc(request=None, corpus_id=None, cooc_id=None, type=None, n=150):
weight[cooccurrence.ngramx.terms] = weight.get(cooccurrence.ngramx.terms, 0) + cooccurrence.score
<<<<<<< HEAD
df = pd.DataFrame(matrix).T.fillna(0)
=======
df = pd.DataFrame(matrix).fillna(0)
>>>>>>> master
x = copy(df.values)
x = x / x.sum(axis=1)
......@@ -209,16 +189,10 @@ def get_cooc(request=None, corpus_id=None, cooc_id=None, type=None, n=150):
partition = best_partition(G)
<<<<<<< HEAD
if type == "node_link":
=======
if type == "node_link":
for community in set(partition.values()):
#print(community)
G.add_node("cluster " + str(community), hidden=1)
>>>>>>> master
for node in G.nodes():
try:
#node,type(labels[node])
......@@ -226,11 +200,7 @@ def get_cooc(request=None, corpus_id=None, cooc_id=None, type=None, n=150):
G.node[node]['name'] = node
G.node[node]['size'] = weight[node]
G.node[node]['group'] = partition[node]
<<<<<<< HEAD
#G.add_edge(node, partition[node], weight=3)
=======
G.add_edge(node, "cluster " + str(partition[node]), weight=3)
>>>>>>> master
# G.node[node]['color'] = '19,180,300'
except Exception as error:
print(error)
......
......@@ -237,17 +237,8 @@ def project(request, project_id):
)
try:
<<<<<<< HEAD
#corpus.parse_resources.apply_async((), countdown=1)
corpus.parse_resources()
# async
corpus.children.filter(type_id=type_document.pk).extract_ngrams(keys=['title',])
#corpus.children.filter(type_id=type_document.pk).extract_ngrams(keys=['title',])
=======
corpus.parse_and_extract_ngrams()
#corpus.parse_and_extract_ngrams.apply_async((), countdown=3)
>>>>>>> master
except Exception as error:
print(error)
......@@ -476,10 +467,6 @@ def send_csv(request, corpus_id):
return response
<<<<<<< HEAD
=======
>>>>>>> master
# To get the data
from gargantext_web.api import JsonHttpResponse
from analysis.functions import get_cooc
......@@ -513,7 +500,6 @@ def graph_it(request):
}))
return HttpResponse(html)
<<<<<<< HEAD
def tests_mvc(request):
'''Just a test page for Javascript MVC.'''
t = get_template('tests/mvc.html')
......@@ -525,8 +511,6 @@ def tests_mvc(request):
}))
return HttpResponse(html)
=======
>>>>>>> master
def ngrams(request):
'''The ngrams list.'''
t = get_template('ngrams.html')
......
......@@ -59,7 +59,6 @@ Populate the database
python manage.py syncdb
<<<<<<< HEAD
Last steps of configuration
---------------------------
......@@ -95,6 +94,7 @@ Last steps of configuration
Extras
=======
Last steps of configuration:
----------------------------
......@@ -126,10 +126,6 @@ patch /srv/gargantext_env/lib/python3.4/site-packages/cte_tree/models.py /srv/ga
/srv/gargantext/manage.py shell < /srv/gargantext/init/init.py
Extras:
>>>>>>> master
======
Start the Python Notebook server
--------------------------------
......
......@@ -30,8 +30,5 @@ sudo apt-get install libopenblas-dev
sudo apt-get install liblapack-dev
<<<<<<< HEAD
=======
source /srv/gargantext_env/bin/activate
pip install git+https://github.com/mathieurodic/aldjemy.git
>>>>>>> master
pip3 install git+https://github.com/mathieurodic/aldjemy.git
......@@ -6,11 +6,7 @@ Pillow==2.5.3
Pygments==1.6
SQLAlchemy==0.9.8
South==1.0
<<<<<<< HEAD
# aldjemy==0.3.51
=======
aldjemy==0.3.10
>>>>>>> master
amqp==1.4.6
anyjson==0.3.3
billiard==3.3.0.18
......
......@@ -129,11 +129,7 @@
<ol>
<li><a href="/corpus/{{ corpus.id }}/matrix">Adjacency matrix</a></li>
<li><a href="/corpus/{{ corpus.id }}/explorer">Static maps</a></li>
<<<<<<< HEAD
<li>Dynamics maps</li>
=======
<li>Dynamic maps</li>
>>>>>>> master
</ol>
</div>
</div>
......
......@@ -5,11 +5,7 @@
{% load staticfiles %}
<link rel="stylesheet" href="{% static "css/bootstrap.css" %}">
<link rel="stylesheet" href="{% static "css/bootstrap-theme.min.css" %}">
<<<<<<< HEAD
<link rel="stylesheet" href="{% static "css/d3matrix.css" %}">
=======
<!-- <link rel="stylesheet" href="{% static "css/d3matrix.css" %}"> -->
>>>>>>> master
<style>
.background {
......@@ -37,23 +33,19 @@ text.active {
</div>
</div>
<<<<<<< HEAD
=======
<div class="container">
>>>>>>> master
<div id="graphid" style="visibility: hidden;">/corpus/{{ corpus.id }}/adjacency.json</div>
<div id="graphid" style="visibility: hidden;">/corpus/{{ corpus.id }}/adjacency.json</div>
<script src="{% static "js/jquery/jquery.min.js" %}" type="text/javascript"></script>
<script src="{% static "js/d3/d3.v2.min.js" %}"></script>
<script src="{% static "js/jquery/jquery.min.js" %}" type="text/javascript"></script>
<script src="{% static "js/d3/d3.v2.min.js" %}"></script>
<p>Order: <select id="order">
<option value="name">by Name</option>
<option value="count">by Frequency</option>
<option value="group">by Cluster</option>
</select>
</p>
<p>Order: <select id="order">
<option value="name">by Name</option>
<option value="count">by Frequency</option>
<option value="group">by Cluster</option>
</select>
</p>
</div>
......@@ -70,20 +62,13 @@ var x = d3.scale.ordinal().rangeBands([0, width]),
var svg = d3.select("body").append("svg")
.attr("width", width + margin.left + margin.right)
.attr("height", height + margin.top + margin.bottom)
<<<<<<< HEAD
//.style("margin-left", -margin.left + "px")
=======
.style("margin-left", "25%")
>>>>>>> master
.append("g")
.attr("transform", "translate(" + margin.left + "," + margin.top + ")");
var filename = document.getElementById("graphid").innerHTML
d3.json(filename, function(miserables) {
<<<<<<< HEAD
=======
>>>>>>> master
var matrix = [],
nodes = miserables.nodes,
n = nodes.length;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment