Commit 53d202f5 authored by Administrator's avatar Administrator

[FEAT] Adding parameters to function to prepare micro dynamics

parents d24461b7 cfce48d6
...@@ -69,7 +69,7 @@ def create_whitelist(user, corpus, size=100): ...@@ -69,7 +69,7 @@ def create_whitelist(user, corpus, size=100):
return white_list return white_list
#def create_cooc(user, corpus, whitelist, blacklist, synonymes): #def create_cooc(user, corpus, whitelist, blacklist, synonymes):
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):
cursor = connection.cursor() cursor = connection.cursor()
try: try:
...@@ -169,7 +169,7 @@ def get_cooc(request=None, corpus_id=None, cooc_id=None, type=None, n=150): ...@@ -169,7 +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 weight[cooccurrence.ngramx.terms] = weight.get(cooccurrence.ngramx.terms, 0) + cooccurrence.score
df = pd.DataFrame(matrix).T.fillna(0) df = pd.DataFrame(matrix).fillna(0)
x = copy(df.values) x = copy(df.values)
x = x / x.sum(axis=1) x = x / x.sum(axis=1)
......
...@@ -71,7 +71,11 @@ Last steps of configuration: ...@@ -71,7 +71,11 @@ Last steps of configuration:
sudo tar xvjf gargantext_lib.tar.bz2 sudo tar xvjf gargantext_lib.tar.bz2
sudo chown user:user /srv/gargantext_lib sudo chown user:user /srv/gargantext_lib
3) Explorer: 3) Explorer:
create mkdir /srv/gargantext_lib/js
sudo chown -R user:user /srv/gargantext_lib/
cd /srv/gargantext_lib/js cd /srv/gargantext_lib/js
git clone git@github.com:PkSM3/garg.git git clone git@github.com:PkSM3/garg.git
...@@ -100,6 +104,6 @@ Start the Python Notebook server ...@@ -100,6 +104,6 @@ Start the Python Notebook server
Start the Django server Start the Django server
----------------------- -----------------------
in bash to launch python env : /srv/gargantext_env/bin/activate
In Pyvenv: In Pyvenv:
python manage.py runserver python manage.py runserver
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