Count unit frequency

Goal

Count the frequency of each segment type that appears in a segmentation.

Prerequisites

Some text has been imported in Orange Textable (see Cookbook: Text input) and it has been segmented in smaller units (see Cookbook: Segment text in smaller units).

Ingredients

Widget

Count

Icon

count_icon

Quantity

1

Procedure

Count unit frequency globally with an instance of Count

Figure 1: Count unit frequency with an instance of Count.

  1. Create an instance of Count.

  2. Drag and drop from the output (righthand side) of the widget that emits the segments that will be counted, here Segment (letters), to the input of Count (lefthand side).

  3. Double-click on the icon of Count to open its interface.

  4. In the Units section, select the segmentation containing units to be counted in the Segmentation drop-down menu (here: letters).

  5. Click the Send button or tick the Send automatically checkbox.

  6. A table showing the results is then available at the output of Count; to display or export it, see Cookbook: Table output.

Comment

  • The total number of segments in your segmentation appears at the bottom of Count’s interface (here: 148023).

  • It is also possible to define units as segment pairs (bigrams), triples (trigrams), and so on, by increasing the Sequence length parameter in the Units section.

  • If Sequence length is set to a value greater than 1, the string appearing in the Intra-sequence delimiter field will be inserted between the elements composing each n-gram in the column headers, which can enhance their readability. The default is # but you can change it to the delimiter of your choice.

See also