OpenICL  by Shark-NLP

Open-source framework for in-context learning research

created 2 years ago
569 stars

Top 57.4% on sourcepulse

GitHubView on GitHub
Project Summary

OpenICL is an open-source framework designed to streamline research, development, and prototyping of in-context learning (ICL) for large language models. It offers an easy-to-use interface with built-in state-of-the-art retrieval and inference methods, enabling systematic comparison of LMs and rapid prototyping.

How It Works

OpenICL facilitates ICL by abstracting the complexities of data preparation, prompt engineering, and model inference. Users define a DatasetReader to load and structure data, optionally use PromptTemplate to format prompts with in-context examples, and then initialize a Retriever (e.g., TopkRetriever) to select relevant examples. Finally, an Inferencer (e.g., PPLInferencer) uses the retriever and template to generate predictions, which can be evaluated using tools like AccEvaluator. This modular design allows for easy swapping of components to compare different ICL strategies.

Quick Start & Requirements

  • Install: pip install openicl
  • Prerequisites: Python 3.8+
  • Local Development: git clone https://github.com/Shark-NLP/OpenICL && cd OpenICL && pip install -e .
  • Documentation: OpenICL Documentation (currently updating)

Highlighted Details

  • Supports LLaMA models and self-consistency techniques (v0.1.8).
  • Integrates with Hugging Face Datasets for easy data loading.
  • Provides modular components for retrieval, prompting, and inference.
  • Includes an AccEvaluator for scoring predictions.

Maintenance & Community

The project was authored by Zhenyu Wu and others, with a paper published on arXiv. Community links are not explicitly provided in the README.

Licensing & Compatibility

The repository does not explicitly state a license in the provided README. Compatibility for commercial use or closed-source linking is not specified.

Limitations & Caveats

The documentation is noted as "updating," suggesting potential incompleteness or ongoing changes. The specific license and its implications for commercial use are not detailed.

Health Check
Last commit

1 year ago

Responsiveness

1 day

Pull Requests (30d)
0
Issues (30d)
0
Star History
15 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.