Repository: modelscope/evalscope
Issue: 使用RAGAS进行评测时，报错：Resource averaged_perceptron_tagger_eng not found.
Root cause: Environment Incompatibility

## 自查清单

在提交 issue 之前，请确保您已完成以下步骤:
- [x] 我已仔细阅读了[相关使用说明文档](https://evalscope.readthedocs.io/zh-cn/latest/get_started/parameters.html)
- [x] 我已查看了[常见问题解答](https://evalscope.readthedocs.io/zh-cn/latest/get_started/faq.html)
- [x] 我已搜索并查看了现有的 issues，确认这不是一个重复的问题

## 问题描述

使用RAGAS进行评测时，报错：Resource averaged_perceptron_tagger_eng not found.

## EvalScope 版本（必填）
v2.0.0

## 使用的工具
- [x] RAGEval backend

## 执行的代码或指令

from evalscope.run import run_task
from evalscope.utils.logger import get_logger

generate_testset_task_cfg = {
    "eval_backend": "RAGEval",
    "eval_config": {
        "tool": "RAGAS",
        "testset_generation": {
            "docs": ["README_zh.md"],
            "test_size": 10,
            "output_file": "outputs/testset.json",
            "knowledge_graph": "outputs/knowledge_graph.json",
            "generator_llm": {
                "model_name_or_path": "/nfs/largemodel/model/DeepSeek-R1-Distill-Llama-70B",
            },
            "embeddings": {
                "model_name_or_path": "AI-ModelScope/m3e-base",
            },
            "language": "chinese"
        }
    },
}
eval_task_cfg = {
    "eval_backend": "RAGEval",
    "eval_config": {
        "tool": "RAGAS",
        "eval": {
            "testset_file": "outputs/testset_with_answer.json",
            "critic_llm": {
                "model_name_or_path": "/nfs/largemodel/model/DeepSeek-R1-Distill-Llama-70B",
            },
            "embeddings": {
                "model_name_or_path": "AI-ModelScope/m3e-base",
            },
            "metrics": [
                "Faithfulness",
                "AnswerRelevancy",
                "ContextPrecision",
                "AnswerCorrectness",
            ],
            "language": "chinese"
        },
    },
}

logger = get_logger()


run_task(task_cfg=generate_testset_task_cfg)


## 错误日志

![Image](https://github.com/user-attachments/assets/8f987f65-2f0d-4bc1-88fa-2358eeb14de0)

python RAGAS_llm.py 
2025-05-20 17:41:52,682 - evalscope - INFO - Args: Task config is provided with dictionary type.
[2025-05-20 17:41:58,534] [INFO] [real_accelerator.py:239:get_accelerator] Setting ds_accelerator to cuda (auto detect)
2025-05-20 17:41:59,387 - evalscope - INFO - Dump task config to ./outputs/20250520_174152/configs/task_config_9af578.yaml
2025-05-20 17:41:59,388 - evalscope - INFO - {
    "model": "DummyCustomModel",
    "model_id": "dummy-model",
    "model_args": {},
    "model_task": "text_generation",
    "template_type": null,
    "chat_template": null,
    "datasets": [],
    "dataset_args": {},
    "dataset_dir": "/mnt/workspace/.cache/modelscope/hub/datasets",
    "dataset_hub": "modelscope",
    "generation_config": {},
    "eval_type": "custom",
    "eval_backend": "RAGEval",
    "eval_config": {
        "tool": "RAGAS",
        "testset_generation": {
            "docs": [
                "README_zh.md"
            ],
            "test_size": 10,
            "output_file": "outputs/testset.json",
            "knowledge_graph": "outputs/knowledge_graph.json",
            "generator_llm": {
                "model_name_or_path": "/nfs/largemodel/model/DeepSeek-R1-Distill-Llama-70B"
            },
            "embeddings": {
                "model_name_or_path": "AI-ModelScope/m3e-base"
            },
            "language": "chinese"
        }
    },
    "stage": "all",
    "limit": null,
    "eval_batch_size": 1,
    "mem_cache": false,
    "use_cache": null,
    "work_dir": "./outputs/20250520_174152",
    "outputs": null,
    "ignore_errors": false,
    "debug": false,
    "dry_run": false,
    "seed": 42,
    "api_url": null,
    "api_key": "EMPTY",
    "timeout": null,
    "stream": false,
    "judge_strategy": "auto",
    "judge_worker_num": 1,
    "judge_model_args": {}
}
2025-05-20 17:41:59,586 - evalscope - INFO - Check `ragas` Installed
Traceback (most recent call last):
  File "//RAGAS_llm.py", line 49, in <module>
    run_task(task_cfg=generate_testset_task_cfg)
  File "/evalscope/evalscope/run.py", line 31, in run_task
    return run_single_task(task_cfg, run_time)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/evalscope/evalscope/run.py", line 42, in run_single_task
    result = run_non_native_backend(task_cfg, outputs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/evalscope/evalscope/run.py", line 89, in run_non_native_backend
    backend_manager.run()
  File "/evalscope/evalscope/backend/rag_eval/backend_manager.py", line 87, in run
    self.run_ragas(testset_args, eval_args)
  File "/evalscope/evalscope/backend/rag_eval/backend_manager.py", line 57, in run_ragas
    generate_testset(TestsetGenerationArguments(**testset_args))
  File "/evalscope/evalscope/backend/rag_eval/ragas/tasks/testset_generation.py", line 88, in generate_testset
    documents = load_data(args.docs)
                ^^^^^^^^^^^^^^^^^^^^
  File "/evalscope/evalscope/backend/rag_eval/ragas/tasks/testset_generation.py", line 73, in load_data
    if nltk.data.find('taggers/averaged_perceptron_tagger_eng') is False:
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/nltk/data.py", line 579, in find
    raise LookupError(resource_not_found)
LookupError: 
**********************************************************************
  Resource averaged_perceptron_tagger_eng not found.
  Please use the NLTK Downloader to obtain the resource:

  >>> import nltk
  >>> nltk.download('averaged_perceptron_tagger_eng')
  
  For more information see: https://www.nltk.org/data.html

  Attempted to load taggers/averaged_perceptron_tagger_eng

  Searched in:
    - '/root/nltk_data'
    - '/usr/local/nltk_data'
    - '/usr/local/share/nltk_data'
    - '/usr/local/lib/nltk_data'
    - '/usr/share/nltk_data'
    - '/usr/local/share/nltk_data'
    - '/usr/lib/nltk_data'
    - '/usr/local/lib/nltk_data'
**********************************************************************

## 运行环境

- 操作系统：ubuntu
- Python版本：3.11.11

## 其他信息

如果有其他相关信息，请在此处提供。


请参照报错内容，运行：
```
import nltk
nltk.download('averaged_perceptron_tagger_eng')
```

> 请参照报错内容，运行：
> 
> ```
> import nltk
> nltk.download('averaged_perceptron_tagger_eng')
> ```

加上之后，报了新的错：

![Image](https://github.com/user-attachments/assets/db50d3eb-d6c3-4cbe-b143-afdeb4647b50)

请参考这个文档：https://evalscope.readthedocs.io/zh-cn/latest/user_guides/backend/rageval_backend/ragas.html
调整doc参数

> 请参考本文档：https://evalscope.readthedocs.io/zh-cn/latest/user_guides/backend/rageval_backend/ragas.html 调整doc参数

又报了这个错：

![Image](https://github.com/user-attachments/assets/0618adf9-daa5-4748-96a4-7175fa412c1a)