Coder Social home page Coder Social logo

serena-fang / rest-api Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vitality-vis/rest-api

0.0 0.0 0.0 120 KB

Contains source code of the Python+Flask based REST API for VitaLITy tasks e.g., find similar papers.

License: MIT License

HTML 0.80% Python 99.20%

rest-api's Introduction

vitaLITy - REST API

Requirements:

  • Python 3.8+
  • Conda (similar to virtualenv + pip)

Setup

  • Create a new environment: conda create --name env_vitality_rest_api anaconda or conda create --name env_vitality_rest_api python=3.8 (based on specific python version)
  • Activate the environment: conda activate env_vitality_rest_api
  • Add conda-forge to the channel: conda config --append channels conda-forge
  • Install requirements: conda install --yes --file requirements.txt

Run

  • Configure options pertaining to the input data source, its type in config.py

  • python server.py - wait until you see three logs: "loaded data" and "created query index for glove" and "created query index for specter"; this may take 3-4 minutes and look like the below screenshot: Logs

  • The REST-API will then be available at http://localhost:3000. Use this in the frontend/src/components/App.tsx file as the baseUrl variable.

Topic API configuration

  • GET /getPapers(): Returns all papers

  • GET /getTopics(): Returns all topics

  • POST /getRepresentativePapers(): Returns representative papers by Topic ID, Topic Keyword

    {
        "input_data": ["bias", "uncertainty"], // [list<Keyword>], [list<ID>] depending on the input_type below
        "input_type": "Keyword", // Keyword, ID
        "limit": 3, // any number less than the number of papers available.
    }
  • POST /getSimilarTopicsByTopic(): Returns similar topics by topics

    {
        "input_data": [3, 4, 5], // [list<Keyword>], [list<ID>] depending on the input_type below
        "input_type": "ID", // Keyword, ID
        "limit": 3, // any number less than the number of papers available.
    }
  • POST /getSimilarTopicsByPaper(): Returns similar topics by ID, Title

    {
        "input_data": ["An Intermittent Click Planning Model.", "Tool Extension in Human-Computer Interaction."], // [list<Title>], [list<ID>] depending on the input_type below
    "input_type": "Title", // Title, ID
    "limit": 3, // any number less than the number of papers available.
    }
  • POST /getTopicsByKeyword(): Returns similar topics by Keywords

    {
        "input_data": ["VisUaLiSAtion"], // [list<Keywords>], case insensitive
        "limit": 3, // any number, -1 for all
    }

API configuration

  • GET /getPapers(): Returns all papers

  • POST /getSimilarPapers(): Returns similar papers by ID, Title

    {
        "input_data": ["An Intermittent Click Planning Model.", "Tool Extension in Human-Computer Interaction."], // [list<Title>], [list<ID>] depending on the input_type below
        "input_type": "Title", // Title, ID
        "limit": 3, // any number less than the number of papers available.
        "embedding": "glove", //glove, specter
        "dimensions": "2D" // 2D, nD
    }
  • POST /getSimilarPapersByKeyword(): Returns similar papers by Keywords

    {
        "input_data": ["DaTa VisUaLiSAtion"], // [list<Keywords>], case insensitive
        "limit": 3, // any number, -1 for all
    }
  • POST /getSimilarPapersByAbstract(): Returns similar papers by Abstract and Title

    {
    "input_data": {
        "title": "Any WIP Title", // string
        "abstract": "Any WIP abstract" // string
    },
    "limit": 3
    }
  • POST /checkoutPapers(): Download a list of dictionaries (JSON) of papers by ID, Title.

    {
        "input_data": ["An Intermittent Click Planning Model.", "Tool Extension in Human-Computer Interaction."], // [list<Title>], [list<ID>] depending on the input_type below
        "input_type": "Title" // Title, ID
    }

Credits

vitaLITy was created by Arpit Narechania, Alireza Karduni, Ryan Wesslen, and Emily Wall.

Citation

@article{narechania2021vitality,
  title={vitaLITy: Promoting Serendipitous Discovery of Academic Literature with Transformers \& Visual Analytics},
  author={Narechania, Arpit and Karduni, Alireza and Wesslen, Ryan and Wall, Emily},
  journal={IEEE Transactions on Visualization and Computer Graphics},
  year={2021},
  doi={10.1109/TVCG.2021.3114820},
  publisher={IEEE}
}

License

The software is available under the MIT License.

Contact

If you have any questions, feel free to open an issue or contact Arpit Narechania.

rest-api's People

Contributors

serena-fang avatar arpitnarechania avatar

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.