We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 780504c commit 3a3dde6Copy full SHA for 3a3dde6
examples/textract.ex
@@ -0,0 +1,34 @@
1
+defmodule AWS.Examples.Textract do
2
+
3
+ @doc"""
4
+ Examples of analyzing a document.
5
+ REF: https://docs.aws.amazon.com/textract/latest/dg/text-location.html
6
+ """
7
+ def analyze_document do
8
+ case AWS.Client.create("ACCESS_KEY", "SECRET_KEY", "REGION")
9
+ |> AWS.Textract.analyze_document(%{
10
+ "Document" => %{
11
+ "Bytes" =>
12
+ "/folder/file"
13
+ |> File.read!()
14
+ |> Base.encode64()
15
+ },
16
+ "FeatureTypes" => ["TABLES"]
17
+ }) do
18
+ {
19
+ :ok,
20
+ %{
21
+ "AnalyzeDocumentModelVersion" => _,
22
+ "Blocks" => blocks,
23
+ "DocumentMetadata" => _
24
+ } = _results,
25
+ _response
26
+ } ->
27
+ # Process the results
28
+ nil
29
30
+ error ->
31
+ error
32
+ end
33
34
+end
0 commit comments