llama-index readers imdb_review integration
Project description
IMDB MOVIE REVIEWS LOADER
pip install llama-index-readers-imdb-review
This loader fetches all the reviews of a movie or a TV-series from IMDB official site. This loader is working on Windows machine and it requires further debug on Linux. Fixes are on the way
Install the required dependencies
pip install -r requirements.txt
The IMDB downloader takes in two attributes
- movie_name_year: The name of the movie or series and year
- webdriver_engine: To use edge, google or gecko (mozilla) webdriver
- generate_csv: Whether to generate csv file
- multithreading: whether to use multithreading or not
Usage
from llama_index.readers.imdb_review import IMDBReviews
loader = IMDBReviews(
movie_name_year="The Social Network 2010", webdriver_engine="edge"
)
docs = loader.load_data()
The metadata has the following information
- date of the review (date)
- title of the review (title)
- rating of the review (rating)
- link of the review (link)
- whether the review is spoiler or not (spoiler)
- number of people found the review helpful (found_helpful)
- total number of votes (total)
It will download the files inside the folder movie_reviews with the filename as the movie name
EXAMPLES
This loader can be used with both Langchain and LlamaIndex.
LlamaIndex
from llama_index.core import VectorStoreIndex, download_loader
from llama_index.core import VectorStoreIndex
from llama_index.readers.imdb_review import IMDBReviews
loader = IMDBReviewsloader(
movie_name_year="The Social Network 2010",
webdriver_engine="edge",
generate_csv=False,
multithreading=False,
)
docs = loader.load_data()
index = VectorStoreIndex.from_documents(documents)
query_engine = index.as_query_engine()
response = query_engine.query(
"What did the movie say about Mark Zuckerberg?",
)
print(response)
Langchain
from langchain.llms import OpenAI
from langchain.agents.agent_toolkits.pandas import (
create_pandas_dataframe_agent,
)
from langchain.agents import Tool
from langchain.agents import initialize_agent
from langchain.chat_models import ChatOpenAI
from llama_index.readers.imdb_review import IMDBReviews
loader = IMDBReviewsloader(
movie_name_year="The Social Network 2010",
webdriver_engine="edge",
generate_csv=False,
multithreading=False,
)
docs = loader.load_data()
tools = [
Tool(
name="LlamaIndex",
func=lambda q: str(index.as_query_engine().query(q)),
description="useful for when you want to answer questions about the movies and their reviews. The input to this tool should be a complete english sentence.",
return_direct=True,
),
]
llm = ChatOpenAI(temperature=0)
agent = initialize_agent(tools, llm, agent="conversational-react-description")
agent.run("What did the movie say about Mark Zuckerberg?")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file llama_index_readers_imdb_review-0.5.0.tar.gz.
File metadata
- Download URL: llama_index_readers_imdb_review-0.5.0.tar.gz
- Upload date:
- Size: 13.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4f15625194e123db83586aeecc466c343bd6d9aaaa99cf33f458a95a85b2cb2b
|
|
| MD5 |
9a31f9ee387b8cc6d2f1a49d8975249f
|
|
| BLAKE2b-256 |
3e2b74d3066eeeb99a7a40f1fd68263a0b921bb0cf20aefa58c27204fbd8029a
|
File details
Details for the file llama_index_readers_imdb_review-0.5.0-py3-none-any.whl.
File metadata
- Download URL: llama_index_readers_imdb_review-0.5.0-py3-none-any.whl
- Upload date:
- Size: 13.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
48441cea4d885ed1c337bc145d6b8dea3bf974f5e815e7a3024479e1e29ab7bc
|
|
| MD5 |
7b85f6b4032bc05a080349b064d94e52
|
|
| BLAKE2b-256 |
602e8993f3d8eff7038c487c0c005a5eb4956df258cb906284362cd6d1a71b6c
|