easyeval-tool


Nameeasyeval-tool JSON
Version 0.0.1 PyPI version JSON
download
home_pagehttps://github.com/zjunlp/EasyEval/tree/main
SummaryEasyEval
upload_time2023-10-16 08:25:38
maintainer
docs_urlNone
authorYida Xue
requires_python>=3.7.0
license
keywords ai nlp instruction language model
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # EasyEval

---

## 馃敡Installation

**Installation for local development:**

```
git clone https://github.com/zjunlp/EasyEval
cd EasyEval
pip install -e .
```
**Installation using PyPI:**
```
pip install easyeval -i https://pypi.org/simple
```
---

## 馃搶Use EasyEval

### FairEval

> `FairEval` is the class for  two simple yet effective strategies,
> namely Multiple Evidence Calibration (MEC) and Balanced Position Calibration (BPC) to calibrate the positional bias of LLMs.
> Refer to the paper: [Large Language Models are not Fair Evaluators](https://link.zhihu.com/?target=https%3A//arxiv.org/pdf/2305.17926v1.pdf).

**Example**

**Step1: Provide the question json file for evaluation.** Here is an example of the data:
```json
{"question_id": 1, "text": "How can I improve my time management skills?"}
{"question_id": 2, "text": "What are the most effective ways to deal with stress?"}
```
**Step2: Provide the answer json files for evaluation.** Note that the question_id  must be consistent with the question file. Here is an example of the data:
```json
{"question_id": 1, "text": "Here are some tips to improve your time management skills:\n\n1. Create a schedule: Make a to-do list for the day ..."}
{"question_id": 2, "text": "Here are some effective ways to deal with stress:\n\n1. Exercise regularly: Physical activity can help reduce stress and improve mood ..."}
```
**Step3: Evaluation**
```python
from EasyEval.eval import FairEval

# Declare a eval class
eval = FairEval(answer_file_list=["YOUR-ANSWER-FILE1", "YOUR-ANSWER-FILE2"], question_file="YOUR-QUESTION-FILE",
                output="YOUR-OUTPUT-FILE", api_key="YOUR-KEY", eval_model='gpt-4', bpc=1, k=3)


# Get the result from LLM API service
eval.fair_eval()
```

---

## 馃帀Contributors

<a href="https://github.com/zjunlp/EasyEval/graphs/contributors">
  <img src="https://contrib.rocks/image?repo=zjunlp/EasyEval" />
</a>
            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/zjunlp/EasyEval/tree/main",
    "name": "easyeval-tool",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7.0",
    "maintainer_email": "",
    "keywords": "AI,NLP,instruction,language model",
    "author": "Yida Xue",
    "author_email": "xueyida@qq.com",
    "download_url": "https://files.pythonhosted.org/packages/b3/45/87bd973a050d96039672e131b18e969a0bfee87d78aefa834a0ef4b84248/easyeval-tool-0.0.1.tar.gz",
    "platform": null,
    "description": "# EasyEval\n\n---\n\n## \u9983\u6561Installation\n\n**Installation for local development:**\n\n```\ngit clone https://github.com/zjunlp/EasyEval\ncd EasyEval\npip install -e .\n```\n**Installation using PyPI:**\n```\npip install easyeval -i https://pypi.org/simple\n```\n---\n\n## \u9983\u6436Use EasyEval\n\n### FairEval\n\n> `FairEval` is the class for  two simple yet effective strategies,\n> namely Multiple Evidence Calibration (MEC) and Balanced Position Calibration (BPC) to calibrate the positional bias of LLMs.\n> Refer to the paper: [Large Language Models are not Fair Evaluators](https://link.zhihu.com/?target=https%3A//arxiv.org/pdf/2305.17926v1.pdf).\n\n**Example**\n\n**Step1: Provide the question json file for evaluation.** Here is an example of the data:\n```json\n{\"question_id\": 1, \"text\": \"How can I improve my time management skills?\"}\n{\"question_id\": 2, \"text\": \"What are the most effective ways to deal with stress?\"}\n```\n**Step2: Provide the answer json files for evaluation.** Note that the question_id  must be consistent with the question file. Here is an example of the data:\n```json\n{\"question_id\": 1, \"text\": \"Here are some tips to improve your time management skills:\\n\\n1. Create a schedule: Make a to-do list for the day ...\"}\n{\"question_id\": 2, \"text\": \"Here are some effective ways to deal with stress:\\n\\n1. Exercise regularly: Physical activity can help reduce stress and improve mood ...\"}\n```\n**Step3: Evaluation**\n```python\nfrom EasyEval.eval import FairEval\n\n# Declare a eval class\neval = FairEval(answer_file_list=[\"YOUR-ANSWER-FILE1\", \"YOUR-ANSWER-FILE2\"], question_file=\"YOUR-QUESTION-FILE\",\n                output=\"YOUR-OUTPUT-FILE\", api_key=\"YOUR-KEY\", eval_model='gpt-4', bpc=1, k=3)\n\n\n# Get the result from LLM API service\neval.fair_eval()\n```\n\n---\n\n## \u9983\u5e00Contributors\n\n<a href=\"https://github.com/zjunlp/EasyEval/graphs/contributors\">\n  <img src=\"https://contrib.rocks/image?repo=zjunlp/EasyEval\" />\n</a>",
    "bugtrack_url": null,
    "license": "",
    "summary": "EasyEval",
    "version": "0.0.1",
    "project_urls": {
        "Homepage": "https://github.com/zjunlp/EasyEval/tree/main"
    },
    "split_keywords": [
        "ai",
        "nlp",
        "instruction",
        "language model"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b34587bd973a050d96039672e131b18e969a0bfee87d78aefa834a0ef4b84248",
                "md5": "55b6ff375bbe152ed81b90ea2fb52b71",
                "sha256": "ecd4e2d6f663d5289c37e3721ec52033455c14b5cbb994f833dbddded878c6a1"
            },
            "downloads": -1,
            "filename": "easyeval-tool-0.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "55b6ff375bbe152ed81b90ea2fb52b71",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7.0",
            "size": 4894,
            "upload_time": "2023-10-16T08:25:38",
            "upload_time_iso_8601": "2023-10-16T08:25:38.497926Z",
            "url": "https://files.pythonhosted.org/packages/b3/45/87bd973a050d96039672e131b18e969a0bfee87d78aefa834a0ef4b84248/easyeval-tool-0.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-10-16 08:25:38",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "zjunlp",
    "github_project": "EasyEval",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "easyeval-tool"
}
        
Elapsed time: 0.13601s