entity

Purpose

Finds documents that contain argument term(s) corresponding to entities from the parent node "Entity Extraction".

Syntax

entity([type], [attributes],…​)

Arguments

One or more optional arguments of string type:

  • The first argument restricts the entity type ("People", "Companies", "Dates", etc.)

  • The next arguments define the entity attributes.

The entity types and attributes are listed in the table below:

entity

attribute

examples

People

Name

entity(people, name:="Martin Luther King Junior")

FirstName

entity(people, firstname:=Martin)

MiddleName

entity(people, middlename:!=Luther)

LastName

entity(people, lastname:=King)

Postfix

entity(people, postfix:=junior)

Attribute

entity(people, attribute:=prime minister|president)

Gender

entity(people, gender:=male)

Age

entity(people, age:>25)

Companies

Name

entity(companies, name:="Bank of America Corp.")

Type

entity(companies, type:="Ltd.|Inc.")

Location

entity(companies, location:=Italy|Spain)

Industry

entity(companies, industry:="financial services")

Abbreviation

entity(companies, abbreviation:=BAC)

Organizations

Name

entity(organizations, name:="World Trade Organization")

Type

entity(organizations, type:="international trade organization")

Location

entity(organizations, location:=international)

Industry

entity(organizations, industry:=trade)

Abbreviation

entity(organizations, abbreviation:=WTO)

Geoadministrative

Name

entity(geoadministrative, name:="San Francisco")

Category

entity(geoadministrative, category:=country|city)

World part

entity(geoadministrative, world part:!=Europe|Asia)

Country

entity(geoadministrative, category:=city, country:="United States")

Region

entity(geoadministrative, city:=California)

Landforms

Name

entity(landforms, name:="Gulf of Mexico")

Type

entity(landforms, type:=gulf)

Facilities

Name

entity(facilities, name:="7th Avenue")

Type

entity(facilities, type:=avenue)

Post Addresses

Address

entity(post addresses, address:="117 S. 17th Street 1600, Philadelphia, PA 19103, United States")

Country

entity(post addresses, country:="United States")

State

entity(post addresses, state:=Pennsylvania)

City

entity(post addresses, city:=Philadelphia)

Street

entity(post addresses, street:="S. 17th Street")

House

entity(post addresses, house:>60)

Floor

entity(post addresses, floor:=10)

Apartment

entity(post addresses, apartment:!="")

PostalBox

entity(post addresses, postalbox:=3231)

PostalCode

entity(post addresses, postalcode:=19103)

Internet Addresses

URL

entity(internet addresses, url:="http://www.youtube.com/watch?v=lkqj9gdc2us")

Domain

entity(internet addresses, domain:="youtube.com")

Email Addresses

Email

entity(email addresses, email:="editor@see-news.com")

User

entity(email addresses, user:=editor)

Server

entity(email addresses, server:="see-news.com")

Phone Numbers

Phone

entity(phone numbers, phone:="(495) 380-4132")

Extension

entity(phone numbers, extension:!="")

Dates

DateTime

entity(dates, datetime:="March 13, 2007 - 05:55:00 PM")

Year

entity(dates, year:=2007)

Month

entity(dates, month:=March|April)

Day

entity(dates, day:<13)

WeekDay

entity(dates, weekday:=Saturday|Sunday)

Time

entity(dates, time:="05:55:00 PM")

Date

entity(dates, date:="13.03.2007 17:55:00")

Currencies

Value

entity(currencies, value:="0.12 - 0.15 USD")

Amount

entity(currencies, amount:=0.12)

AmountTo

entity(currencies, amountto:=0.15)

Currency

entity(currencies, currency:=USD)

Units

Value

entity(units, value:="14-15 tons")

Amount

entity(units, amount:>14, unit:=kilogram)

AmountTo

entity(units, amountto:<15, unit:=ton)

Unit

entity(units, unit:=gram|kilogram)

Area

entity(units, area:=mechanics)

Class

entity(units, class:=mass|volume|length)

Category

entity(units, class:=mass|volume|length, category:=metric)

You can also search for a specified attribute of an entity instead of the whole match.

The target attribute is set with field named parameter. For example, use entity(People, field:=LastName) to search for last names in the found matches for the People entities.

In order to filter out the results of the entity() function, one can use the regex() function. Thus, the query entity("People", Match:="regex(.*manager.*)") will leave in the results the People entities containing the word "manager", for example, "Mr. Jordan Smith, section manager of AIL Research and Development".

Returned Value

Documents matching the query.

Examples

entity(People, Gender:=male, Age:>25) returns the mentions of males over 25 years old;

entity() - returns the mentions of all entities in the dataset;

entity(People, King) returns the mentions of the people whose names or attributes contain the word "king", e.g. "King Fernando I" or "Martin Luther King";

entity(Currencies, Amount:>100, Amount:<300, Currency:=USD) returns "$299", "125 dlrs";

entity(Post Addresses, field:=Street) returns the mentions of street names for the entity Post Addresses, e.g. for the entity "12141 Lewis Street, Garden Grove, CA, United States" the function will return "Lewis Street".