{'fraction_non_alphanumeric': 0.019398642095053348, 'fraction_numerical': 0.0, 'mean_word_length': 5.531645569620253, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Annotated Document Spanners

We introduce annotated document spanners, which are document spanners that can annotate their output tuples with elements from a semiring. Such spanners are useful for modeling soft constraints, which are popular in practical information extraction tools. 
We introduce a finite automaton model for such spanners, which generalizes vset-automata and weighted automata, and prove that this model is closed under the relational algebra operations union, projection, natural join that have been considered in the work on provenance in databases. Concerning selection, we generalize a characterization of Fagin et al., proving that a string relation R is recognizable if and only if the regular spanners are closed under selection using R. 
Finally we consider evaluation and enumeration problems for annotated document spanners and provide a number of tractability- and intractability results. For achieving tractability, fundamental properties of the underlying semiring, such as positivity, are crucial.