Skip to main content

Merge. Synthesize. Create. Dialektik generates new content by fusing ideas from diverse sources, revealing unexpected insights and perspectives.

Project description

Dialektik

Merge. Synthesize. Create. Dialektik generates new content by fusing ideas from diverse sources, revealing unexpected insights and perspectives through a dialectical process.

Features

  • Loads and processes datasets from multiple sources
  • Summarizes text into concise bullet points
  • Generates thesis, antithesis, and synthesis from summarized content
  • Supports various AI models for text generation
  • Model-agnostic design allows easy swapping of different LLMs

Requirements

  • Required: datasets, huggingface_hub
  • Optional: phi-3-vision-mlx (required only if you need to create a new dataset with the provided setup() function for custom dataset processing)

Installation

To install Dialektik with core dependencies only:

pip install dialektik

To install Dialektik with all dependencies, including those required for the setup() function:

pip install dialektik[setup]

Note: Install the full version if you plan to process custom datasets using the setup() function.

Usage

Command Line Interface

Dialektik can be used from the command line after installation. Here are some example usages:

  1. Generate a synthesis with default settings:

    dialektik
    
  2. Specify sources:

    dialektik --source arxiv
    
  3. Set the number of books, bullet points per book, and choose a different model:

    dialektik --num-book 5 --per-book 4 --model "your-preferred-model"
    
  4. Run the setup function:

    dialektik --setup
    
  5. For a full list of options, use:

    dialektik --help
    

Python API

You can also use Dialektik in your Python scripts:

from dialektik import synthesize

# Generate a synthesis with default settings
thesis, antithesis, synthesis = synthesize()

# Customize the synthesis process
output = synthesize(
   list_source=['your_source'],
   num_book=3,
   per_book=3,
   api_model="mistralai/Mistral-Nemo-Instruct-2407"
)

Accessing the Dataset

The default dataset at 'JosefAlbers/StampyAI-alignment-research-dataset' is publicly available. You don't need to set up any environment variables or run the setup() function to use dialektik with this dataset.

(Optional) Using Custom Datasets

If you want to use your own dataset:

  1. Prepare your dataset according to the required format.
  2. Modify the PATH_DS variable in the code to point to your dataset.
  3. If your dataset is private or requires authentication, set up the following environment variables:
    • HF_WRITE_TOKEN: Hugging Face write token (for pushing datasets)
    • HF_READ_TOKEN: Hugging Face read token (for accessing private datasets)

Note: The setup() function provided in the code is a demonstration of how you might process a custom dataset. Different datasets may require different processing steps, so you'll need to adapt this function to your specific needs.

Customizing the LLM

Dialektik is designed to be model-agnostic. The default model is "mistralai/Mistral-Nemo-Instruct-2407", but you can easily change this by passing a different api_model parameter to the synthesize() function.

Output

The synthesize() function generates three outputs:

  1. Thesis: An article exploring the main themes and insights from the selected sources.
  2. Antithesis: A text presenting alternative perspectives and counterarguments to the thesis.
  3. Synthesis: A reconciliation of the thesis and antithesis, presenting a new, unified viewpoint.

All outputs are saved in the 'syntheses' folder with timestamps for easy reference.

License

This project is licensed under the MIT License.

Citation

DOI

Contributing

Contributions to Dialektik are always welcome! Please feel free to submit a Pull Request.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dialektik-0.0.2.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

dialektik-0.0.2-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file dialektik-0.0.2.tar.gz.

File metadata

  • Download URL: dialektik-0.0.2.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.3

File hashes

Hashes for dialektik-0.0.2.tar.gz
Algorithm Hash digest
SHA256 5ec7e78789889d4f396e877d70e3269d38ed3272daabebf133a382a298486ead
MD5 a759ebc249d6db93f488c2f1128ca938
BLAKE2b-256 22b06bd6ae19b608e63237ea971286cdde9c3dae644d6ba015aede26ee6ec0df

See more details on using hashes here.

File details

Details for the file dialektik-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: dialektik-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.3

File hashes

Hashes for dialektik-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5df70a55d1ec7d8761c6171a81987af9f22fde7f0a28c12a42f8eca4868fcdc5
MD5 ee70300f16453a51747cf26ca7e31049
BLAKE2b-256 89667a53111135b78366ec3c28670fac9cb7a3c99790c087ae3db5b829ca1cc3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page