文档情报提取税基值

问题描述 投票:0回答:1

我正在使用 documentIntelligence 从收据中提取元素。税收详细信息如下所示:

![enter image description here

我的问题是:我如何修改这个结果,使识别也返回税基值。在本例中为 1.36。

azure
1个回答
0
投票

我如何修改此结果以使识别也返回税基值。在本例中为 1.36。

在提取税务详细信息之前,您需要找到收据中的税基值。这可能涉及搜索“税基”、“小计”等关键字或任何其他税前基本金额的指示。

  • 确定税基值的位置后,您可以使用收据中的
    document Intelligence
    提取它。
import re

# Sample receipt text
receipt_text = "Subtotal: $1.36\nTax Details: IVA (21%): $0.29, IGIC (7%): $0.07"

# Define regular expression pattern to capture subtotal
subtotal_pattern = r"Subtotal: \$([\d.]+)"

# Extract subtotal using regular expression
subtotal_match = re.search(subtotal_pattern, receipt_text)

# Extracted tax base value
tax_base_value = subtotal_match.group(1) if subtotal_match else None

print("Tax Base Value:", tax_base_value)
  • 您可以自定义它。使用包含税基值的其他收据示例训练模型。这将帮助模型学习识别和提取这些特定信息。

  • 使用Document Intelligence 样本标签工具在一些样本收据中手动标记税基值。

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.