### Install Financial Datasets from GitHub Repository Source: https://github.com/virattt/financial-datasets/blob/main/README.md Detailed steps to install the Financial Datasets library directly from its GitHub repository. This method is useful for contributing to the project or using the latest unreleased features, involving cloning the repository and installing dependencies with Poetry. ```bash git clone https://github.com/virattt/financial-datasets.git ``` ```bash cd financial-datasets ``` ```bash poetry install ``` -------------------------------- ### Install Financial Datasets Library via pip Source: https://github.com/virattt/financial-datasets/blob/main/README.md Command to install the `financial-datasets` Python library using the pip package manager, which is the standard way to install Python packages. ```bash pip install financial-datasets ``` -------------------------------- ### Example Generated Financial Dataset Structure Source: https://github.com/virattt/financial-datasets/blob/main/README.md Illustrates the JSON structure of a financial question-answer dataset generated by the library, including questions, answers, and contextual information derived from financial documents. ```json [ { "question": "What was Airbnb's revenue in 2023?", "answer": "$9.9 billion", "context": "In 2023, revenue increased by 18% to $9.9 billion compared to 2022, primarily due to a 14% increase in Nights and Experiences Booked of 54.5 million combined with higher average daily rates driving a 16% increase in Gross Booking Value of $10.0 billion." }, { "question": "By what percentage did Airbnb's net income increase in 2023 compared to the prior year?", "answer": "153%", "context": "Net income in 2023 increased by 153% to $4.8 billion, compared to the prior year, driven by our revenue growth, increased interest income, discipline in managing our cost structure, and the release of a portion of our valuation allowance on deferred tax assets of $2.9 billion." } ] ``` -------------------------------- ### Add Financial Datasets to Poetry Project Source: https://github.com/virattt/financial-datasets/blob/main/README.md Command to add the `financial-datasets` library as a dependency to a project managed by Poetry, a dependency management and packaging tool for Python. ```bash poetry add financial-datasets ``` -------------------------------- ### Generate Financial Dataset from Arbitrary Text Source: https://github.com/virattt/financial-datasets/blob/main/README.md Demonstrates how to use the `DatasetGenerator.generate_from_texts` method to create a financial dataset from a provided list of string texts. This method offers the most flexibility for custom text inputs and requires an OpenAI model and API key for LLM integration. ```python from financial_datasets.generator import DatasetGenerator # Your list of texts texts = ... # Create dataset generator generator = DatasetGenerator(model="gpt-4-turbo", api_key="your-openai-key") # Generate dataset from texts dataset = generator.generate_from_texts( texts=texts, max_questions=100, ) ``` -------------------------------- ### Generate Financial Dataset from PDF URL Source: https://github.com/virattt/financial-datasets/blob/main/README.md Illustrates the use of `DatasetGenerator.generate_from_pdf` to generate a financial dataset directly from a PDF document accessible via a URL. This simplifies the process for documents available online and requires an OpenAI model and API key. ```python from financial_datasets.generator import DatasetGenerator # Create dataset generator generator = DatasetGenerator(model="gpt-4-turbo", api_key="your-openai-key") # Generate dataset from PDF url dataset = generator.generate_from_pdf( url="https://www.berkshirehathaway.com/letters/2023ltr.pdf", max_questions=100, ) ``` -------------------------------- ### Generate Financial Dataset from 10-K Report Source: https://github.com/virattt/financial-datasets/blob/main/README.md Shows how to generate a financial dataset specifically from a 10-K report using a ticker symbol and year with `DatasetGenerator.generate_from_10K`. It also supports an optional `item_names` parameter to specify particular sections of the 10-K to process. Requires an OpenAI model and API key. ```python from financial_datasets.generator import DatasetGenerator # Create dataset generator generator = DatasetGenerator(model="gpt-4-turbo", api_key="your-openai-key") # Generate dataset from 10-K dataset = generator.generate_from_10K( ticker="AAPL", year=2023, max_questions=100, item_names=["Item 1", "Item 7"], # optional - specify Item names to use ) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.