semvec/pypi-packages huggingface dataset:
ZTSentecneTransformerGPT 0.1.0
A package for text generation and sentence similarity using GPT-2 and Sentence Transformers
License: MIT
Requires Python: >=3.8

# SentenceTransformerGPT2

A Python package to suggest similar sentences and generate text using fine-tuned SentenceTransformer and GPT-2 models.

## Installation

Install the package from PyPI:

```bash
pip3 install ZTSentecneTransformerGPT

#### No need to use model directories

## sample uses
```
from your_package_name import SentenceTransformerGPT2

### Initialize the model
model = SentenceTransformerGPT2()

### Define candidate sentences
candidate_sentences = [
    'I am going to school',
    'He went to the market',
    'The weather is great today'
]

### Define a query sentence
query_sentence = 'I open the door'

### Number of top similar sentences to return
top_n = 3

### Get similar sentences
similar_sentences = model.suggest_similar_sentences(query_sentence, candidate_sentences, top_n=top_n)
for sentence, similarity in similar_sentences:
    print(f"Sentence: {sentence}, Similarity: {similarity:.4f}")
    if similarity <= 0.7:
        # Generate text if similarity is low
        generated_texts = model.generate_text(query_sentence, num_return_sequences=3)
        for text in generated_texts:
            print(f"Here is suggested text: {text}")

```