## IMDB MOVIE REVIEWS LOADER
```bash
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
```python
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
```python
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
```python
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?")
```
Raw data
{
"_id": null,
"home_page": null,
"name": "llama-index-readers-imdb-review",
"maintainer": "Athe-kunal",
"docs_url": null,
"requires_python": "<4.0,>=3.9",
"maintainer_email": null,
"keywords": "IMDB, movies, reviews",
"author": "Your Name",
"author_email": "you@example.com",
"download_url": "https://files.pythonhosted.org/packages/d5/8b/8de71b8f0aa69269e1a46a857b4e56f93d577b51b4e7360bf7c97d153085/llama_index_readers_imdb_review-0.3.0.tar.gz",
"platform": null,
"description": "## IMDB MOVIE REVIEWS LOADER\n\n```bash\npip install llama-index-readers-imdb-review\n```\n\nThis 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\n\nInstall the required dependencies\n\n```\npip install -r requirements.txt\n```\n\nThe IMDB downloader takes in two attributes\n\n- movie_name_year: The name of the movie or series and year\n- webdriver_engine: To use edge, google or gecko (mozilla) webdriver\n- generate_csv: Whether to generate csv file\n- multithreading: whether to use multithreading or not\n\n## Usage\n\n```python\nfrom llama_index.readers.imdb_review import IMDBReviews\n\nloader = IMDBReviews(\n movie_name_year=\"The Social Network 2010\", webdriver_engine=\"edge\"\n)\ndocs = loader.load_data()\n```\n\nThe metadata has the following information\n\n- date of the review (date)\n- title of the review (title)\n- rating of the review (rating)\n- link of the review (link)\n- whether the review is spoiler or not (spoiler)\n- number of people found the review helpful (found_helpful)\n- total number of votes (total)\n\nIt will download the files inside the folder `movie_reviews` with the filename as the movie name\n\n## EXAMPLES\n\nThis loader can be used with both Langchain and LlamaIndex.\n\n### LlamaIndex\n\n```python\nfrom llama_index.core import VectorStoreIndex, download_loader\nfrom llama_index.core import VectorStoreIndex\n\nfrom llama_index.readers.imdb_review import IMDBReviews\n\nloader = IMDBReviewsloader(\n movie_name_year=\"The Social Network 2010\",\n webdriver_engine=\"edge\",\n generate_csv=False,\n multithreading=False,\n)\ndocs = loader.load_data()\n\nindex = VectorStoreIndex.from_documents(documents)\nquery_engine = index.as_query_engine()\n\nresponse = query_engine.query(\n \"What did the movie say about Mark Zuckerberg?\",\n)\nprint(response)\n```\n\n### Langchain\n\n```python\nfrom langchain.llms import OpenAI\nfrom langchain.agents.agent_toolkits.pandas import (\n create_pandas_dataframe_agent,\n)\nfrom langchain.agents import Tool\nfrom langchain.agents import initialize_agent\nfrom langchain.chat_models import ChatOpenAI\n\nfrom llama_index.readers.imdb_review import IMDBReviews\n\nloader = IMDBReviewsloader(\n movie_name_year=\"The Social Network 2010\",\n webdriver_engine=\"edge\",\n generate_csv=False,\n multithreading=False,\n)\ndocs = loader.load_data()\ntools = [\n Tool(\n name=\"LlamaIndex\",\n func=lambda q: str(index.as_query_engine().query(q)),\n 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.\",\n return_direct=True,\n ),\n]\nllm = ChatOpenAI(temperature=0)\nagent = initialize_agent(tools, llm, agent=\"conversational-react-description\")\nagent.run(\"What did the movie say about Mark Zuckerberg?\")\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "llama-index readers imdb_review integration",
"version": "0.3.0",
"project_urls": null,
"split_keywords": [
"imdb",
" movies",
" reviews"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "3c08ce5b94edf38d0f07ff13dceb962ec6c332b6d3ef36751ec8ed3ebc3020df",
"md5": "c1fabdcfaaa9e9a9aa24de7085deac9d",
"sha256": "b6eef2b515a1d85e2f852d3c9d89bd7b03895fffdc51633e4871d10dc315b4f1"
},
"downloads": -1,
"filename": "llama_index_readers_imdb_review-0.3.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "c1fabdcfaaa9e9a9aa24de7085deac9d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.9",
"size": 6672,
"upload_time": "2024-11-18T00:16:24",
"upload_time_iso_8601": "2024-11-18T00:16:24.065810Z",
"url": "https://files.pythonhosted.org/packages/3c/08/ce5b94edf38d0f07ff13dceb962ec6c332b6d3ef36751ec8ed3ebc3020df/llama_index_readers_imdb_review-0.3.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "d58b8de71b8f0aa69269e1a46a857b4e56f93d577b51b4e7360bf7c97d153085",
"md5": "afd01a613321b39180d545c9f032cf8c",
"sha256": "2b724f5214a07d1732684b3f589a929ae5119150cf0be1bcfd59633b778b6ab7"
},
"downloads": -1,
"filename": "llama_index_readers_imdb_review-0.3.0.tar.gz",
"has_sig": false,
"md5_digest": "afd01a613321b39180d545c9f032cf8c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.9",
"size": 5980,
"upload_time": "2024-11-18T00:16:25",
"upload_time_iso_8601": "2024-11-18T00:16:25.097127Z",
"url": "https://files.pythonhosted.org/packages/d5/8b/8de71b8f0aa69269e1a46a857b4e56f93d577b51b4e7360bf7c97d153085/llama_index_readers_imdb_review-0.3.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-18 00:16:25",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "llama-index-readers-imdb-review"
}