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
  • Performs semantic search for topic-based content selection
  • Generates thesis, antithesis, and synthesis from summarized content
  • Uses phi-3-vision-mlx for text generation and embeddings

Requirements

  • Python 3.8+
  • datasets
  • huggingface_hub
  • phi_3_vision_mlx
  • mlx
  • fire

Installation

To install Dialektik with all required dependencies:

pip install dialektik

Note: Make sure you have the necessary system requirements to run phi-3-vision-mlx and mlx.

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:

    python dialektik.py
    
  2. Specify a topic for semantic search:

    python dialektik.py --topic "AI agents"
    
  3. Specify sources and exclude certain terms:

    python dialektik.py --list_source arxiv --list_exclude MIRI "Machine Intelligence Research Institute"
    
  4. Set the number of books and bullet points per book:

    python dialektik.py --num_book 5 --per_book 4
    
  5. Use a different language model via API:

    python dialektik.py --llm_model "mistralai/Mistral-Nemo-Instruct-2407"
    
  6. For a full list of options, use:

    python dialektik.py --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(
   topic="AI agents",
   list_source=['arxiv'],
   list_exclude=['MIRI', 'Machine Intelligence Research Institute'],
   num_book=3,
   per_book=3
)

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 to use dialektik with this dataset.

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)

Customizing the Model

Dialektik now uses phi-3-vision-mlx for text generation and embeddings. This model is not easily swappable, but you can modify the pv.load() and pv.generate() calls in the code if you need to use a different model.

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.3a0.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

dialektik-0.0.3a0-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file dialektik-0.0.3a0.tar.gz.

File metadata

  • Download URL: dialektik-0.0.3a0.tar.gz
  • Upload date:
  • Size: 5.6 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.3a0.tar.gz
Algorithm Hash digest
SHA256 2580ccd67b5fed59a381c4f6492ba4fedd1d54d8e57287a3448c114b483f050b
MD5 ac6929dd7db7fcc14275c78bc5f9495b
BLAKE2b-256 6c2ead0ec2c01bbb2fffe7eff675e60c9a5b5c8481f665c84fc658b963eb67f3

See more details on using hashes here.

File details

Details for the file dialektik-0.0.3a0-py3-none-any.whl.

File metadata

  • Download URL: dialektik-0.0.3a0-py3-none-any.whl
  • Upload date:
  • Size: 5.9 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.3a0-py3-none-any.whl
Algorithm Hash digest
SHA256 e0ba51034cf2efd10edaefb95ed9b50fd508212b9688376a76ce4a3d77b6a576
MD5 fd89c8fb8854b55da68269fbaecc896a
BLAKE2b-256 b5ce500c393f454628dd918c42b2f60bfa9e96ec874c44d04c702626a02ce83e

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