semvec/pypi-packages huggingface dataset:
fincompass 0.1.0
A comprehensive toolkit for large model evaluation
Requires Python: >=3.8.0
Keywords: AI,NLP,in-context learning

**Welcome to FinCompass**!

**FinCompass**旨在面向金融NLPer，更便捷地对金融领域NLP模型的性能进行公平全面的评估。FinCompass在具备丰富的算法和功能的基础上，支持灵活的文件配置式评测，使得NLPer更高效地新增评测数据与模型。FinCompass 将不断致力于为NLPer提供准确、可靠的评估工具，以更好地理解和提升金融领域的NLP模型。

## 最新进展

- **\[2023.08.18\]** 新增面向模型训练者的框架部署流程，针对新增评测集和模型，只需修改`run.json`配置文件。
- **\[~2023.08.16\]** 基于官方框架新增10个中文评测数据集、11类金融领域评测任务以及6个模型评测接口；评测功能上，支持机器评估与人工评估两类评估方式；新增F1、GPT等评测基准。

## 评测流程

### 1. 运行环境配置
- python环境


```
$ conda create --name {deepai} python=3.10
```

```
$ conda activate {deepai}
```

- 安装依赖

```
$ unzip opencompass.zip
$ cd opencompass
$ pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple 
```

- 安装opencompass库

```
$ pip install -e .
```

- 检测环境是否配置成功

```
$ python run.py configs/eval_demo.py -w outputs/demo --debug
```
如果一切正常，屏幕上会出现 “Starting inference process”

![debug](./imgs/debug.png)

### 2. 评测流程配置

如果运行环境配置完成，用户便可配置项目中的`run.json`文件，指定相关参数，即可对新增的数据集和模型进行评测。后续评测过程只需更改配置参数即可。

1. **修改`run.json`配置文件**

```json
{
  "dataset_name": "nlpcc",
  "dataset_path": "data/test/nlpcc_test.json",
  "prompt_key": ["question", "triple"],
  "answer_key": "answer",
  "prompt_template": "请根据知识库中的三元组知识回答问题,三元组知识为: {triple}\n请问答问题: {question}\n答案: ",
  "evaluator": "ROUGE",
  "model_name": "minimax",
  "generateURL": "http://ip:port/api/v1/eval/minimax",
  "request_data": {
    "data":{
      "question": ""
    },
    "times": 0
  },
  "recieve_data": {
    "data":{
      "prediction": ""
    }
  },
  "max_seq_len": 2048,
  "max_out_len": 512,
  "sample_size": 2
}
```

2. **执行评测指定**

```shell
python run.py configs/eval_base.py -w outputs/base
```

> Todo: 后面使用.sh文件

**json配置字段说明：**

- `dataset_name`：str，数据集名称，用于与其他数据集区分。
- `dataset_path`：str，数据集文件路径。

- `prompt_key`：list，构造prompt需要的字段。
- `answer_key`：str，标准答案字段。
- `prompt_template`：str，prompt样例，`{字段}`来源于`prompt_key`。
- `evaluator`：str，评估指标，目前可选项：`EM`、`ROUGE`。不支持自定义指标。
- `model_name`：str，模型名称，用于与其他模型区分。
- `generateURL`：str，模型接口链接。
- `request_data`：dict，请求字段设置。必须包含`data:{question:""}`字段，其他可自定义，比如模型的初始化参数。
- `recieve_data`：dict，接收字段设置。此处无需修改，用于告知用户返回字段必须包含`data:{prediction:""}`字段。
- `max_seq_len`：int，模型最大输入指定。也可在`request_data`字段中根据需求设定。
- `max_out_len`：int，模型最大输入指定。也可在`request_data`字段中根据需求设定。
- `sample_size`：int，指定个评估数据的样例个数，用于debug，选择方式为随机采样。

**!注意!**

当前版本，评测集必须为json格式数据，需要明确指定`prompt_key`字段和`answer_key`字段，且`prompt_key`需要在`prompt_template`字符串中出现。

## 性能榜单

**通用能力**

![image-20230818192047059](./imgs/bangdan.png)

**金融能力**

<img src="./imgs/fin.png" alt="image-20230818192620845" style="zoom: 33%;" />

## 数据集支持

<img src="./imgs/dataset.png" alt="image-20230818192317348" style="zoom: 33%;" />

## 模型支持

- 文心一言 ernie-bot
- 文心一言 ernie-bot-turbo（10B）
- gpt-3.5-turbo
- 面壁cpmbee-api
- minimax-api
- ChatGLM-6B
- ChatGLM2-6B
- llama-7b
- Baichuan-7B
- internlm_7b
- CPMBEE-10B
- ...
blob-mounting-helper-utility 1.1.4
Blob mapping utility for easy translation between azure urls and local paths
Keywords: python,azure,blob,mount


# Blob mapping utility

When your code needs to access many mapped blobs as a mounted folder, the utility to make translation between blob urls and filepaths easier was made.
It can be configured using the configuration json file.

You can also use this utility to download and uploads the blobs to/from the local file system without having to worry about the filepaths.

Configuration file example:

``` json
{
  "blob_mounting_configurations": [
    {
      "storage_account_name": "examplestagingstrgacc",
      "storage_account_url": "https://examplestagingstrgacc.blob.core.windows.net/",
      "container_name": "example-container-raw",
      "mount_point": "/mnt/example-container-raw"
    }
  ]
}
```

## How to use

```python
from blob_mounting_helper_utility import BlobMappingUtility
json_config_file = "blob_mapping_config.json"

# read the file into a dictionary
with open(json_config_file) as json_file:
    config = json.load(json_file)["blob_mounting_configurations"]

# create the utility object
blob_mapping_utility = BlobMappingUtility(config)

filepath1 = "/mnt/example-container-raw/cool_picture.png
blob_url = blob_mapping_utility.get_url_from_mounted_filepath(filepath1) # -> https://examplestagingstrgacc.blob.core.windows.net/example-container-raw/cool_picture.png

filepath2 = get_mounted_filepath_from_url(blob_url) # -> /mnt/example-container-raw/cool_picture.png
```

Also, if you were to pass the azure storage account key you can download and upload the blob to a local file path:

```python
from blob_mounting_helper_utility import BlobMappingUtility
json_config_file = "blob_mapping_config.json"

# read the file into a dictionary
with open(json_config_file) as json_file:
    config = json.load(json_file)["blob_mounting_configurations"]

azure_storage_account_key = "example_key"
# create the utility object
blob_mapping_utility = BlobMappingUtility(config, azure_storage_account_key)
url = "https://examplestagingstrgacc.blob.core.windows.net/example-container-raw/cool_picture.png"
blob_mapping_utility.download_blob(url) # -> Downloads the blob to the local file path "/mnt/example-container-raw/cool_picture.png"
local_filepath = "/mnt/example-container-raw/cool_picture.png"
do_something_to_file(local_filepath)
blob_mapping_utility.upload_blob(local_filepath) # -> Uploads the file to the blob url
blob_mapping_utility.cleanup_files() # cleans both downloaded and uploaded files from the local file system

```
numtofi 0.8
A package to convert numbers to Finnish textual representation

# `numtofi` - Convert numbers to Finnish textual representation

`numtofi` is a Python module that offers functionality to convert integers into their Finnish textual representation. This module also comes with a command-line interface (CLI) tool to quickly get the Finnish representation for any number from the command line.

## Installation

```bash
pip install numtofi
```

## Usage

### As a Python Module

```python
from numtofi import number_to_text

print(number_to_text(45))  # Outputs "neljÃ¤kymmentÃ¤viisi"
```

### Command-Line Interface (CLI)

After installation, you can use the `numtofi` command directly from your terminal:

```bash
$ numtofi 45
neljÃ¤kymmentÃ¤viisi

$ numtofi 5000000
viisi miljoonaa

$ numtofi 5000000 --nospaces
viisimiljoonaa

$ numtofi 5000000 --length
15

```

## Parameters

- `number_to_text(n, spaces=False)`:
  - `n (int)`: The number to convert.
  - `spaces (bool)`: If `False`, removes spaces between words. Default is `True`.

- `number_to_text_length(n, spaces=False)`:
  - `n (int)`: The number to the length of the textual representation.
  - `spaces (bool)`: If `False`, removes spaces between words. Default is `True`.

## Testing

Tests are provided in the `tests` directory. To run the tests:

1. Navigate to the project root directory.
2. Run:

```bash
python -m unittest discover tests
```

## Update PYPI package

```bash
python setup.py sdist bdist_wheel
```

```bash
python -m twine upload dist/*
```

## Contributing

Contributions are welcome! Please make sure to update tests as appropriate when proposing changes.

## License

[MIT](LICENSE)