Semantic Grep#
Application ID
eot_grep
Application Aliases
grep.app eot/grep.app
Description#
The Semantic Grep application can be used to semantically search your documents using a Wowool expression. This means that you can grep for a concept like Person if you have added a domain that contains this concept.
If you have the SDK, a simpler way to use this app is through the command line tool wow.grep
Configuration#
The configuration is an object defined as (bold = required, italic = optional):
expression (
string
) – The Wowool expression to search, for example:"Person"
stem (
bool
) – Matches using the stem instead of the literal
Example#
Finding a sequence of adjectives followed by nouns#
wow -p 'english,syntax,grep(Adj+ Nn+).app' \
-i "I have a nice little green house and a yellow garden shed."
which yields:
{
"matches": [
{
"text": "nice little green house",
"groups": [],
"sentence_index": 0
},
{
"text": "yellow garden shed",
"groups": [],
"sentence_index": 0
}
],
"summary": [
{
"name": "match",
"data": [
{
"count": 1,
"groups": ["nice little green house"]
},
{
"count": 1,
"groups": ["yellow garden shed"]
}
]
}
]
}
Finding references to a Person#
wow -p 'english,entity,grep(Person).app' \
-i "John Smith work for EyeOnID. John is a nice person and he works a lot with Jane Goodmam."
which yields:
{
"matches": [
{
"text": "John Smith",
"groups": [],
"sentence_index": 0
},
{
"text": "John Smith",
"groups": [],
"sentence_index": 1
},
{
"text": "John Smith",
"groups": [],
"sentence_index": 1
},
{
"text": "Jane Goodmam",
"groups": [],
"sentence_index": 1
}
],
"summary": [
{
"name": "match",
"data": [
{
"count": 1,
"groups": [ "Jane Goodmam" ]
},
{
"count": 3,
"groups": [ "John Smith" ]
}
]
}
]
}
Note
In this example, “John Smith” is found three times, but only a single exact match is present. The other two matches (“he” and “John”) are the results of conjecture and anaphora
For an interpretation of the JSON data, refer to the application’s JSON schema.