Это мой код для вызова API
Код: Выделить всё
# Initialize the client
client_options = {"api_endpoint": f"{location}-documentai.googleapis.com"}
client = documentai.DocumentProcessorServiceClient(client_options=client_options)
# The full resource name of the processor
name = client.processor_path(project_id, location, processor_id)
# Read the file into memory
with open(file_path, "rb") as pdf_file:
pdf_content = pdf_file.read()
# Load the input document
raw_document = documentai.RawDocument(
content=pdf_content,
mime_type=mime_type
)
request = documentai.ProcessRequest(
name=name,
raw_document=raw_document
)
Код: Выделить всё
text_anchor {
text_segments {
start_index: 445
end_index: 451
}
}
type_: "vat"
mention_text: "900,00"
confidence: 1
page_anchor {
page_refs {
bounding_poly {
normalized_vertices {
x: 0.277810812
y: 0.455004215
}
normalized_vertices {
x: 0.332540154
y: 0.455004215
}
normalized_vertices {
x: 0.332540154
y: 0.465517253
}
normalized_vertices {
x: 0.277810812
y: 0.465517253
}
}
}
}
id: "0"
properties {
text_anchor {
text_segments {
start_index: 445
end_index: 451
}
content: "900,00"
}
type_: "vat/amount"
mention_text: "900,00"
confidence: 0.501076162
page_anchor {
page_refs {
bounding_poly {
normalized_vertices {
x: 0.277810812
y: 0.455004215
}
normalized_vertices {
x: 0.332540154
y: 0.455004215
}
normalized_vertices {
x: 0.332540154
y: 0.465517253
}
normalized_vertices {
x: 0.277810812
y: 0.465517253
}
}
}
}
id: "1"
normalized_value {
text: "900"
}
}
Как получить значение Tax_rate при вызове API?
Подробнее здесь: https://stackoverflow.com/questions/793 ... g-tax-rate
Мобильная версия