# Anchors

Points on the scanned document that the robot uses to determine where specific data is placed in the document.

With the help of anchors, we set the boundaries of certain attributes. There can be as many anchors as needed, depending on the type of document.

<figure><img src="https://sherparpa.ru/wp-content/uploads/2023/11/image33-459w239h.png" alt=""><figcaption></figcaption></figure>

In our example, we need to extract data for the following attributes:

* "Investor"
* "Customer (General Contractor)"
* "Document Number"
* "Date"

**Creating an Anchor (Attribute "Investor")**

Let's consider the process of creating an anchor using the attribute "Investor" as an example.

![](https://sherparpa.ru/wp-content/uploads/2023/11/image34-590w301h.png)

To create an anchor, we go to the "Anchors" tab in the right workspace of the Template Designer and click the button![](https://sherparpa.ru/wp-content/uploads/2023/11/image35-1.png) at the top of the panel. At this point, "OCR blocks" and "OCR tables" become active for the convenience of selecting a specific block as an anchor.

In order for the Template Designer to correctly determine the location of the attribute in the document, it is necessary to limit its boundaries. The upper boundary is set by the text located one line above the attribute itself. In our case, this is the block "Form by".

To assign a value to the anchor, simply click the left mouse button on the OCR block (word) that we selected as the anchor. You can also specify the value manually by writing the anchor word in the "Value" field.

If we specify the word "Form" as the anchor, the anchor will be set incorrectly, as there are several OCR blocks in the document that recognized this word.

<figure><img src="https://sherparpa.ru/wp-content/uploads/2023/11/image36-605w113h.png" alt=""><figcaption></figcaption></figure>

Therefore, we change the specified anchor value to "Form by". After this, it is necessary to perform a check to ensure that the anchor word has been correctly identified.

When the anchor value is set by clicking on the OCR block, an asterisk "*" is added to the value; if the value is specified manually, this symbol does not need to be added. When using anchor bindings, the asterisk "*" should be removed and then the binding added.

If the value contains two or more words, a space must be placed between them, as it acts as a word separator.

<figure><img src="https://sherparpa.ru/wp-content/uploads/2023/11/image37-605w137h.png" alt=""><figcaption></figcaption></figure>

Next, we add an anchor for the attribute "Investor". For correct recognition of the Investor information, it is necessary to limit this attribute with anchor points on the left and right.

On the left, the anchor will be the word "Investor". We add the anchor by clicking the left mouse button on the OCR block "Investor", and the Template Designer automatically fills in the "Value" field, thereby defining the anchor point.

<figure><img src="https://sherparpa.ru/wp-content/uploads/2023/11/image38-605w120h.png" alt=""><figcaption></figcaption></figure>

On the right, the anchor will be the word "by". Similarly, we add the anchor in the Template Designer's workspace, click on the OCR block "by", perform a check, and add the anchor binding.

After checking, we see that the anchor is set incorrectly, as there are several OCR blocks in the document that recognized the word "by".

To correctly define the anchor, we perform an anchor binding to the anchor "Form by", which is located one line above the block we want to specify as the anchor. To do this, we click the "Add Binding" button, then click on the anchor "Form by", thus binding our new anchor to the OCR block located one line above the desired anchor.

<figure><img src="https://sherparpa.ru/wp-content/uploads/2023/11/image39-605w156h.png" alt=""><figcaption></figcaption></figure>

To ensure that the Template Designer determines the coordinates of the created anchor relative to the anchor "Form by", we specify the binding parameter "Bottom". This parameter indicates that the created anchor will be bound to the anchor "Form by" and is located one line below.

<figure><img src="https://sherparpa.ru/wp-content/uploads/2023/11/image40-258w111h.png" alt=""><figcaption></figcaption></figure>

**Creating an Anchor (Attribute "Customer")**

Similarly, we create anchors for the attribute "Customer". On the left, the anchor will be the word "Customer". We add the anchor by clicking the left mouse button on the OCR block "Customer", and the Template Designer automatically fills in the "Value" field, defining the anchor point.

On the right, the anchor will be the word "by". Similarly, we add the anchor in the Template Designer's workspace, click on the OCR block "by", perform a check, and add the anchor binding. In this case, we bind to the anchor word "by", which is located one line above in the document. We specify the binding parameter "Bottom" and perform a check.

<figure><img src="https://sherparpa.ru/wp-content/uploads/2023/11/image41-605w323h.png" alt=""><figcaption></figcaption></figure>

The attribute "Customer" needs to be limited not only on the right and left but also on the top. To do this, we select the word "organization" as the anchor. We create another anchor, editing the name so that the asterisk "\*" stands on both sides of the word — "*organization*". We check the correctness of the anchor placements.

<figure><img src="https://sherparpa.ru/wp-content/uploads/2023/11/image42-605w138h.png" alt=""><figcaption></figcaption></figure>

When creating anchors that contain multiple words, it is necessary to specify the asterisk "\*" at the end of each word.

If the combination of words appears in the document only once, the second word can be written in abbreviated form. For example, for the document number anchor, we can specify "number\* doc\*".

<figure><img src="https://sherparpa.ru/wp-content/uploads/2023/11/image43-605w162h.png" alt=""><figcaption></figcaption></figure>

If there is an extra character at the beginning of the anchor value (most often this is a bracket), we can remove this character and replace it with an asterisk "*". Thus, we get the value \_*&#x6F;rganizatio&#x6E;*\_ instead of \_(organization*\_.

**Final Anchor**

When creating a template, it is necessary to specify an anchor that will end the document. That is, based on this anchor, we can determine that there are no more tables in the document and that work with tables can be completed.

In our example, the final anchor will be the word "decoding".

<figure><img src="https://sherparpa.ru/wp-content/uploads/2023/11/image44-232w218h.png" alt=""><figcaption></figcaption></figure>

In our example, the final anchor will be the word **decoding\***.

The Template Designer allows you to set several alternative options for the anchor, by which the robot will recognize the final attribute.

We will add the word **signature\***, intentionally indicating it without an ending, as the document may refer to both signature and signatures.

If the document does not contain the word *decoding\**, the robot will look for the word *signature\**

For the final anchor, we specify *Operating mode – LastPage.*
