llama-index-readers-imdb-review


Namellama-index-readers-imdb-review JSON
Version 0.2.0 PyPI version JSON
download
home_pageNone
Summaryllama-index readers imdb_review integration
upload_time2024-08-22 06:21:32
maintainerAthe-kunal
docs_urlNone
authorYour Name
requires_python<4.0,>=3.8.1
licenseMIT
keywords imdb movies reviews
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ## 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.8.1",
    "maintainer_email": null,
    "keywords": "IMDB, movies, reviews",
    "author": "Your Name",
    "author_email": "you@example.com",
    "download_url": "https://files.pythonhosted.org/packages/e6/27/9e0a78f9f44c9ea9bba72e4cb7cf9ae95a8f7a612fc1dcca08d9f5bd7cdc/llama_index_readers_imdb_review-0.2.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.2.0",
    "project_urls": null,
    "split_keywords": [
        "imdb",
        " movies",
        " reviews"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "27c49cafcb3250d0035a8249d731788089df432d13340565fa9c5ac1b3bd8b85",
                "md5": "c7aebed7adbebb27fba726ac90bf4c68",
                "sha256": "a0fe52629a6941d0175e05d9bd6efeafc7cb7d2c4ebf83e0793be4388f563b29"
            },
            "downloads": -1,
            "filename": "llama_index_readers_imdb_review-0.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c7aebed7adbebb27fba726ac90bf4c68",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.8.1",
            "size": 6674,
            "upload_time": "2024-08-22T06:21:30",
            "upload_time_iso_8601": "2024-08-22T06:21:30.839289Z",
            "url": "https://files.pythonhosted.org/packages/27/c4/9cafcb3250d0035a8249d731788089df432d13340565fa9c5ac1b3bd8b85/llama_index_readers_imdb_review-0.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e6279e0a78f9f44c9ea9bba72e4cb7cf9ae95a8f7a612fc1dcca08d9f5bd7cdc",
                "md5": "ca706c4d2225e0e2f2fb679abcb83390",
                "sha256": "a26f1f718334771106fd7535003a5d097be4c89ce7e30836cefae194c25baf85"
            },
            "downloads": -1,
            "filename": "llama_index_readers_imdb_review-0.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "ca706c4d2225e0e2f2fb679abcb83390",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.8.1",
            "size": 5995,
            "upload_time": "2024-08-22T06:21:32",
            "upload_time_iso_8601": "2024-08-22T06:21:32.598969Z",
            "url": "https://files.pythonhosted.org/packages/e6/27/9e0a78f9f44c9ea9bba72e4cb7cf9ae95a8f7a612fc1dcca08d9f5bd7cdc/llama_index_readers_imdb_review-0.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-22 06:21:32",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "llama-index-readers-imdb-review"
}
        
Elapsed time: 0.29557s