> For the complete documentation index, see [llms.txt](https://docs.docbits.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.docbits.com/chinese/guan-li-yu-she-zhi/settings/global-settings/document-types/model-training/testing-the-model.md).

# 测试模型

## 运行分类测试以评估模型准确性和运行就绪情况的步骤

要测试训练好的模型并评估其准确性和运行就绪情况，请按照以下步骤操作：

**准备测试数据：**

* 收集具有代表性的测试数据样本，涵盖模型在实际使用中需要处理的不同文档类型和场景。确保测试数据质量高且标注正确。

**运行分类测试：**

* 使用准备好的测试数据运行分类测试。
* 将测试数据输入模型，并让模型预测文档类别。

<figure><img src="https://1870485400-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlPczlNw8zzYNLfjfispX%2Fuploads%2Fgit-blob-d331b74dd88f70d03e344cea028d740f32336248%2Fimage%20(206).png?alt=media" alt="" width="375"><figcaption><p>设置</p></figcaption></figure>

* 添加新的分类规则，或编辑现有规则。

<figure><img src="https://1870485400-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlPczlNw8zzYNLfjfispX%2Fuploads%2Fgit-blob-16938920de0441e07d553233462ebd94b9e6f68d%2Fimage%20(207).png?alt=media" alt=""><figcaption><p>设置：分类和提取</p></figcaption></figure>

<figure><img src="https://1870485400-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlPczlNw8zzYNLfjfispX%2Fuploads%2Fgit-blob-9d3edf792b57733097e43ecb587e7662a5cddff2%2Fimage%20(205).png?alt=media" alt="" width="276"><figcaption><p>配置分类规则</p></figcaption></figure>

**评估模型准确性：**

* 将模型的预测结果与测试数据的实际分类进行比较。计算准确率、精确率、召回率和 F1 分数等指标，以评估模型的性能。这些指标有助于了解模型对文档分类的效果及其可靠性。

<figure><img src="https://1870485400-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlPczlNw8zzYNLfjfispX%2Fuploads%2Fgit-blob-47d704eee36cdebd4e1fb6c5ea79081c79983d3a%2FBildschirmfoto%202024-05-22%20um%2008.53.41.png?alt=media" alt=""><figcaption></figcaption></figure>

**分析错误：**

* 检查模型在测试数据分类过程中出现的错误，并分析原因。识别错误中的模式或趋势，并在必要时调整模型以提升其性能。

**优化模型**：

* 根据分类测试和错误分析的结果，您可以通过添加训练数据、调整训练参数或更改模型架构来优化模型。重复测试流程，检查优化是否提升了模型性能。

**记录结果：**

* 记录分类测试的结果，以及对模型所做的任何调整或优化。这有助于跟踪模型随时间的进展，并确保其持续改进。

定期运行分类测试并评估模型性能，可以确保模型适用于生产环境并提供准确结果。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.docbits.com/chinese/guan-li-yu-she-zhi/settings/global-settings/document-types/model-training/testing-the-model.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
