Metadata-Version: 2.4
Name: fragmentshot
Version: 0.1.1
Summary: Prompt generation for Fragment-Shot and Pivoted Fragment-Shot translation using LLMs
Author-email: Samuel Frontull <samuel.frontull@uibk.ac.at>
License: MIT
Project-URL: Homepage, https://github.com/schtailmuel/fragmentshot
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# FragmentShot Retriever

A Python package for retrieving exemplary translations for text based on fragments from parallel corpora.  

## Features

- Fragment extraction from source and target texts
- Configurable maximum fragment size
- Option to enable or disable fragment overlaps
- Easy integration for retrieval workflows

## Installation

You can install this package locally:

```bash
pip install .
```

Or clone the repo and install in editable mode:

```bash
git clone https://github.com/schtailmuel/fragmentshot.git
cd fragmentshot
pip install -e .
```

## Usage 

```python 
from fragmentshot.retriever import FragmentShotsRetriever

src_texts = [
    "This is a sample source sentence.",
    "Another example source sentence."
]

tgt_texts = [
    "Dies ist ein Beispiel im Zieltext.",
    "Noch ein Beispiel."
]

result = FragmentShotsRetriever(src_texts, tgt_texts, max_fragment_size=5, overlaps=False)

# Access extracted shots
print(result)
```

## Testing 

Run unit tests with:

```bash
python -m unittest discover tests
```

## License 

This project is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License.

Created by Samuel Frontull
