Modifying PSO relationship types

To create or edit PSO relationship types in TextChart Studio, click Edit PSO types in the LxBase section of the vertical toolbar. You can make modifications through a graphical interface, or by modifying an XML file directly.

The sections below demonstrate using both approaches to add a relational semantic vector named closed_at to the list of semantic vectors that are associated with relationships between TICKER_SYMBOL and PERCENT entities.

Before you begin, make sure that the closed_at semantic vector is present in the list in the Relational tab in TextChart Studio. If it's not there, create it, and then follow either of the following procedures.

GUI

The PSOType Editor page displays the graphical user interfaces for modifying relationship types by default.


PSOType Editor page
  1. In the grid, click on the intersecting point between TICKER_SYMBOL and PERCENT.

  2. In the section on the right, click Add/Remove to open the Predicate Editor dialog.


    Predicate Editor
  3. In the bar at the top, type a predicate that you'll associate with the new semantic vector, and then click Add. In this example, the predicate is also closed_at.

  4. To associate a semantic vector with the new predicate, click the new closed_at button. In the new window on the right, type closed_at in the field at the top of the Semantic Vectors list. Select closed_at from the list.

  5. Close all the new windows, and then click Save. TextChart Studio displays a message at the top of the application window, prompting a restart. Click Restart Studio.


    Restart message
  6. Add the closed_at semantic vector to relevant entries in the lexicon.

XML

To modify PSO relationship types directly, click Edit PSO types in XML Mode in the top right corner of the PSOType Editor window.


PSOType XML editor

Then, you need to find the definition of the relationship type that you want to modify, and add a block of XML like this to it:

<users_predicate maxdistance="9999">
  <sv>
    <users_semantic_vector/>
  </sv>
</users_predicate>

For example, to add a predicate named closed_at (and its associated semantic vector) to the Ticker_SymbolToPercent relationship type, find the <PSOType> element for that type in the file, and then add the following before the </predicatetypes> tag:

<closed_at maxdistance="9999">
  <sv>
    <closed_at/>
  </sv>
</closed_at>

After you edit the file, click the Save button, and restart TextChart Studio.

Creating a PSO relationship type

To create a relationship type when a category for one of the entity types involved is not present in the XML file, you need to add a complete <category> element.

For example, to create a type for relationships between TICKER_SYMBOL and PERCENT entities in the case where neither has its own category, you'd need to add (and modify) the following code:

<category name="Entity_Type1">
  <PSOType name="Entity_Type1ToEntity_Type2" subject="Entity_Type1"
           object="Entity_Type2" reciprocal="true" output="true"
           explicit="false" category="Entity_Type1">
    <predicatetypes>
      <users_predicate maxdistance="9999">
        <sv>
          <users_semantic_vector/>
        </sv>
      </users_predicate>
    </predicatetypes>
  </PSOType>
</category>

On the <PSOType> element, the reciprocal attribute is "true" by default, which means that in our example, TextChart extracts both TICKER_SYMBOL to PERCENT relationships and PERCENT to TICKER_SYMBOL relationships. Setting it to "false" means extracting only TICKER_SYMBOL to PERCENT relationships.

Conversely, the explicit attribute is "false" by default, which makes TextChart extract relationships that are explicitly defined as TICKER_SYMBOL to PERCENT, and other relationships that involve entities of those types, as in both examples below:

  1. AAPL closed at a 3% increase yesterday.

  2. AAPL, +3%, 11-01-2018.

Setting the attribute to "false" means extracting only explicitly TICKER_SYMBOL to PERCENT relationships, as in the first example above.

Finally, setting the output attribute to "true" means that the result of extracting this relationship will be output.