semvec/pypi-packages huggingface dataset:
calculator-main 1.0.1
Calculate the BLEU, ROUGE, PPL scores of large models
Requires Python: >=3.9

BLEU ROUGE PPL 评分计算工具包

## 安装
pip install calculator_main

##  使用
from calculator_main.main import LLMAssessment

## 示例
    # 示例：困惑度计算
    sentences = [
        ['I', 'have', 'a', 'pen'],
        ['He', 'has', 'a', 'book'],
        ['She', 'has', 'a', 'cat']
    ]
    unigram = {
        'I': 1 / 12, 'have': 1 / 12, 'a': 3 / 12, 'pen': 1 / 12,
        'He': 1 / 12, 'has': 2 / 12, 'book': 1 / 12, 'She': 1 / 12, 'cat': 1 / 12
    }
    perplexity = LLMAssessment.calculate_perplexity(sentences, unigram)
    print("困惑度为：", perplexity)

    # 示例：ROUGE分数计算
    generated_text = "This is some generated text."
    reference_text = "This is a reference text."
    rouge_scores = LLMAssessment.calculate_rouge(generated_text, reference_text)
    print("ROUGE分数：", rouge_scores)

    # 示例：BLEU分数计算
    candidate_text = ["This", "is", "some", "generated", "text"]
    reference_texts = [
        ["This", "is", "a", "reference", "text"],
        ["This", "is", "another", "reference", "text"]
    ]
    bleu_scores = LLMAssessment.calculate_bleu(reference_texts, candidate_text)
    print("BLEU分数：", bleu_scores)
dearpygui-forms 0.3.0
Dearpygui extention for autogeneration forms powered by pydantic.
Requires Python: >=3.10

# DearPyGui Forms
Generate GUI forms for your Pydantic models.

## Features
- Fill form fields with Pydantic model data
- Fill from fields with default values
- Validation on form submission
- Callbacks for form submission


Currently supported Pydantic fields:
- nested entities
- arrays
- str
- int
- float
- bool
- datetime
- date
- time
- anyOf sequences


## Example:
```python
from pprint import pprint
import dearpygui.dearpygui as dpg
from pydantic import BaseModel, Field
from dearpygui_forms import DPGForm

class User(BaseModel):
    name: str = Field(default="John Doe", min_length=3)
    age: int = Field(ge=18)


class Storage(BaseModel):
    users: list[User] = []

class UserForm(DPGForm, model=User):
    pass


dpg.create_context()
dpg.create_viewport()

store = Storage()

with dpg.window(label="User Form"):
    user_form = UserForm(callback=lambda x: store.users.append(x))
    user_form.add()
    dpg.add_button(label="Print Users", callback=lambda: pprint(store.model_dump()))
dpg.setup_dearpygui()
dpg.show_viewport()
dpg.start_dearpygui()
dpg.destroy_context()
```