Giter VIP home page Giter VIP logo

conceptvector's Introduction

Conceptvector

Setting up the environment

1. Install Anaconda

  • Download the latest distribution

    wget https://repo.continuum.io/archive/Anaconda2-5.3.0-Linux-x86_64.sh 
    
  • Execute the script

    bash Anaconda2-5.3.0-Linux-x86_64.sh
    

2. Create a custom environment

  • Create a conda environment 'conceptvector'
    conda create -n conceptvector python=2.7 anaconda
    
  • Activate the conda environment
    source activate conceptvector
    pip install -r requirements.txt
    

3. Install uwsgi

conda install -c travis uwsgi

4. Install flask

conda install -c https://conda.anaconda.org/anaconda flask

5. Cloning the source code

git clone https://github.com/intuinno/conceptvector.git

6. Install npm, bower & grunt

sudo apt install npm
sudo  npm install -g bower
sudo  npm install -g grunt

Setting up the client

  • Change the directory to conceptvector/client
  • Build client
    npm install
    bower install
    grunt build
    
  • Run client
    grunt serve
    

Setting up the server

  1. Activate conceptvector environment

    source activate conceptvector
    
  2. Install dependencies

    • Install flask-migrate, flask-bcrypt, flask-restful, flask-cors, marshmallow, ipdb, psycopg2, flask-sqlalchemy
      conda install -c conda-forge flask-migrate flask-bcrypt flask-restful flask-cors marshmallow ipdb psycopg2 flask-sqlalchemy
      
    • Install flask-script
      pip install Flask-Script
      
  3. Setting up environment variables

    • Create the following files

      cd ~/anaconda2/envs/conceptvector/
      mkdir -p ./etc/conda/activate.d
      mkdir -p ./etc/conda/deactivate.d
      
      touch ./etc/conda/activate.d/env_vars.sh
      touch ./etc/conda/deactivate.d/env_vars.sh
      
    • Add the following content to both the files (env_vars.sh)

      export APP_SETTINGS=config.DevelopmentConfig
      export DATABASE_URL=postgresql://postgres:postgres@localhost/conceptvectorDB
      
  4. Download & unzip stanford glove dataset

    • Change the directory to conceptvector/server
    mkdir data
    cd data
    wget http://nlp.stanford.edu/data/glove.6B.zip
    unzip glove.6B.zip
    
  5. Set up database

    • Install PostgreSQL database
      sudo apt install postgresql postgresql-contrib
      
    • Start the databse service
      sudo service postgresql start
      
    • Create a database conceptvectorDB using the default user postgres
      sudo -u postgres createdb conceptvectorDB
      
    • Upgrade the database
      • change the directory to conceptvector/server & run the following command
      python manage.py db upgrade
      
    • At this stage, you should be able to connect to database by following
       psql conceptvectorDB postgres
      
  6. Test the server

    • Activate conceptvector environment
      source activate conceptvector
      
    • Change the directory to conceptvector/server & run the following command
      python manage.py runserver
      
      

Setup with Docker compose

Requirements

  • Docker >= 18.06
  • docker-compose >= 1.22

How to run local server

  1. Clone repository
git clone https://github.com/intuinno/conceptvector.git
  1. Run with docker-compose
cd conceptvector
docker-compose up

Now you can access to local dev server:

http://localhost:9000 for frontend, http://localhost:5000 for backend.

conceptvector's People

Contributors

beomi avatar intuinno avatar shadek07 avatar sylund avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

conceptvector's Issues

Setting up DB

Hi,

I am trying to set up db as in readme.
1. Started the service-
image

2. Created concecptvectorDB -

image

image

when I run python manage.py db upgrade. I get error -
image

I am able to connect to db.
image

I am getting "No data available"
image

Where am I doing wrong ? Is there any step I am missing ?

@Shadek07 please guide.

Thanks,
Jay

docker-compose up throws Error

I followed the instructions on How to run local server, but when I run docker-compose up (as sudo) I get:
ERROR: forbidden path outside the build context: ../compose/server/Dockerfile ()

Changing line 22 from docker-compose.yml from ../compose/server/Dockerfile to ./compose/server/Dockerfile does not solve the issue...

Am I doing something wrong, or could someone please fix it?

Cann't install conceptvector according to Readme. Postgresql issue.

When I try to execute step:
python manage.py db upgrade
I get this error:
OperationalError: (psycopg2.OperationalError) could not connect to server: Connection refused
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5432?
could not connect to server: Connection refused
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?
Restart postgresql according to http://breanneboland.com/blog/2015/08/13/python-with-flask-and-postgresql-is-the-server-running-on-host-localhost-127-0-0-1-and-accepting-tcpip-connections-on-port-5432/ and some others solutions like this doesn't help.

More than that, sometimes i get this:
OperationalError: (psycopg2.OperationalError) FATAL: password authentication failed for user "postgres"
FATAL: password authentication failed for user "postgres"
I tried to change user or change authentication from "peer" to "trust" but it doesn't make sense.

Please, could anyone help me? Any ideas how to fix it?

Understanding dataset

Hi,

I have downloaded dataset from here.

But when I unzip, its like this -
image

But in code, we are using -

image

So, I changed the downloaded file name to "wiki_4gram_50d.txt" But I am getting error.

Wanted to know, Am I using the correct dataset ? or need to use other dataset ?

@Shadek07 please guide.

Thanks,
Jay

KeyError: 'APP_SETTINGS' while upgrading / testing the server

Hi,

I have cloned this repo & trying to setup on my windows machine.

I have created the env_vars.sh file. & added the given content. But when I run python manage.py runserver, getting following error.

image

@Shadek07 Could you please help me, where am I doing wrong or missing anything.

Thanks,
Jay

Please upload Readme..

What to put in DATABASE_URL?
What to put in APP_SETTINGS?
and about other fields too?

problems

Can you tell step by step procedure to run the project...
Please respond ASAP..Its important for our Final Year Project

Thanks in Advance...

Regards,
Saichand Sharma

Understanding dataset

Hi,

I have downloaded dataset from here.

But when I unzip, its like this -
image

But in code, we are using -

image

So, I changed the downloaded file name to "wiki_4gram_50d.txt" But I was getting error.

So I changed the encoding like this -
image

It works fine.

But Wanted to know, Am I using the correct dataset ? or need to use other dataset ?

@Shadek07 please guide.

Thanks,
Jay

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.