GithubHelp home page GithubHelp logo

movie-search's Introduction

Python Flask Code style: black
CI Release cov

Movie Search

API for searching movies by its synopsis. The movie data was gathered from Metacritic, using a web crawler. A reverse index was created based on the terms of the movies synopsis.

The Jaccard Index was used to compute a score value assigned to each document according to specific queries. For each query, a ranking of the 10 most relevant movies is returned, taking into account the terms in the synopsis of each one.

Run with docker

docker pull ghcr.io/vncsmyrnk/movie-search:latest
docker run --rm \
    -p 5000:5000 \
    movie-search:latest

Development

docker run --rm -it \
    -v "$(pwd)"/src:/var/app \
    -p 5000:5000 \
    --workdir /var/app \
    --cpus 2 \
    --name movie-search \
    python:3.9-slim bash
# Inside container
pip install -r requirements.txt
flask --app server run --host 0.0.0.0

Examples

curl -X GET http://localhost:5000/api/query?q=music%20play -s | jq .

Returns:

[
  {
    "movie": {
      "avg_score": 70,
      "description": "Six urbanites play musical beds.",
      "description_cleaned": "six urbanit play music bed",
      "movie_uri": "/movie/your-friends-neighbors/",
      "platform": "metacritic",
      "scores": [
        {
          "reviewer_name": "The A.V. Club",
          "score": "100"
        },
        {
          "reviewer_name": "Newsweek",
          "score": "90"
        },
        {
          "reviewer_name": "TV Guide Magazine",
          "score": "80"
        },
        {
          "reviewer_name": "San Francisco Examiner",
          "score": "75"
        },
        {
          "reviewer_name": "The New Republic",
          "score": "70"
        },
        {
          "reviewer_name": "Los Angeles Times",
          "score": "50"
        },
        {
          "reviewer_name": "San Francisco Chronicle",
          "score": "25"
        }
      ],
      "title": "Your Friends & Neighbors",
      "year": "1998"
    },
    "movie_id": 3304,
    "score_jaccard": 0.4
  },
  {...}
]

movie-search's People

Contributors

vncsmyrnk avatar

Watchers

 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.