SEMANTIC-ANALYSIS

SEMANTIC ANALYSIS

Named Entity Recognition

Entities are people, places, business, brands, and ideas that are notable. Repustate will identify any and all in your text and will return them categorized. The full list of possible themes for a block of text are below:

Request
path Parameters
apikey
required
string

Valid API key for your account

Request Body schema: multipart/form-data
text
string

The block of text you'd like to analyze for named entities & themes

lang
string

The two letter code of the language you want to analyze the sentiment in. The default is English (en); you do not need to specify anything if you're just scoring English text.

Responses
200

OK

post/{apikey}/entities.json
Request samples
curl -d "text=Lowry and Siakam combined for 60 points in the Raps 101-85 win over the Cavs on Sunday" \
https://api.repustate.com/v4/{apikey}/entities.json
Response samples
application/json
{
  • "entities": [
    ],
  • "status": "OK",
  • "themes": [
    ]
}

Aspect-based sentiment

Sometimes sentiment alone isn't enough - you want to know which aspects of a particular subject carry sentiment. For example, if you're a hotel, you might be interested in knowing people's opinions on your staff, as well as your amenities and the food offerings. This API call automatically categorizes text according to industry-specific categories. Below is a list of Repustate IQ's pre-built aspect models as well as the aspects within each model, available for all customers to use:

  • airline (inflight, price, loyalty, staff, food, delays)
  • apparel (size, style, effectiveness, brand, recommend, product impression, weight, price, returns, shipping, quality, activities, features, family, body, clothing, brand)
  • banking (branch, service, technology, products, transaction, price, ATM, bank, staff)
  • cpg (brand, product, packaging, promotions, quality, usability, design, price)
  • ecommerceA (website, payment, shipping, returns, brand, price, product, quality, customer service)
  • government (legislation, budget, economy, leadership, public sentiment, communication, election, political party, government agency)
  • hotel (food, price, staff, location, accommodations, beds, amenities, cleanliness, attractions, tripstyle, meal, hosts, recommendation, bathroom, noise, pool, internet, safety, parking, pests, business-amenities, odor, pets, furniture)
  • insurance (claims, policy, customer service, staff, technology, price, brand, policy type)
  • restaurant (events, food, experience, service, staff, parking, reservations, price, action, intent, technology)
  • retail (store_experience, product, service, staff, fitting_rooms, action, intent, jobs)
  • telecom (staff, product, price, service)
  • voice_of_customer (price, staff, service, cleanliness, shipping, quality, size, availability, packaging, appearance, performance)
  • voice_of_employee (workload, vacation, teamwork and colleagues, performance, salary & benefits, management, promotion & career, recruitment & on-boarding, support & appreciation, communication, job security, work from home, organization, product & technology, achievements, diversity)
  • voice_of_patient (quality of care, medication, diagnosis, service, staff, medical staff, facilities, billing, delays, communication, privacy, food)
Request
path Parameters
apikey
required
string

Valid API key for your account

Request Body schema: multipart/form-data
text
string

The text you'd like to analyze

model
required
any

The group of categories you're interested in using. Options are one of: hotel, airline, telco, retail, restaurant. If you have created your own rules/models using the API calls below, you can also specify the ID of the model you created.

Enum: "hotel" "airline" "telco" "retail" "restaurant"
lang
string

The two letter code of the language you want to analyze the sentiment in. The default is English (en); you do not need to specify anything if you're just scoring English text.

neutral
string

Show chunks that have neutral sentiment. Any value will do here e.g. neutral=1

context
string

Possible values are positive or negative. When analyzing survey responses, it is sometimes useful to include a value for context so Repustate's sentiment engine knows how to analyze the survey response given the question. If the question is 'How can we improve?' it is reasonable to assume the responses will be negative so set context=negative in the API call.

Responses
200

Each matching category will be a top level key with each matching text chunk a member in a list, along with its sentiment score

400

error

post/{apikey}/aspect.json
Request samples
curl -d "text=I loved the rooms but the coffee could have been better&model=hotel" \
https://api.repustate.com/v4/{apikey}/aspect.json
Response samples
application/json
{
  • "accommodations": [
    ],
  • "food": [
    ],
  • "status": "OK"
}

Classifications

List all classifications and their related default themes for the current version of the API

Request
path Parameters
apikey
required
string

Valid API key for your account

Responses
200

OK

get/{apikey}/classifications.json
Request samples
curl https://api.repustate.com/v4/{apikey}/classifications.json
Response samples
application/json
{
  • "Event.activity": [ ],
  • "Event.airplane_crash": [
    ],
  • "Event.award": [ ],
  • "Event.coup": [
    ],
  • "Event.crime": [
    ],
  • "Event.financial": [
    ],
  • "Event.genocide": [
    ],
  • "Event.government_policy": [
    ],
  • "Event.massacre": [ ],
  • "Event.military_operation": [
    ],
  • "Event.social": [ ],
  • "Event.sport": [
    ],
  • "Event.sports": [
    ],
  • "Event.terrorist_attack": [
    ],
  • "Event.trade_show": [ ],
  • "Event.trial": [
    ],
  • "Event.war": [
    ],
  • "Health.artery": [
    ],
  • "Health.bone": [
    ],
  • "Health.disease": [
    ],
  • "Health.disorder": [
    ],
  • "Health.enzyme": [
    ],
  • "Health.muscle": [
    ],
  • "Health.organ": [
    ],
  • "Health.pharmaceutical": [
    ],
  • "Health.surgery": [
    ],
  • "Health.symptom": [
    ],
  • "Health.vitamin": [
    ],
  • "Location.airport": [ ],
  • "Location.borough": [ ],
  • "Location.bridge": [ ],
  • "Location.building": [ ],
  • "Location.canyon": [ ],
  • "Location.city": [ ],
  • "Location.city_area": [ ],
  • "Location.continent": [ ],
  • "Location.convention_centre": [ ],
  • "Location.country": [ ],
  • "Location.county": [ ],
  • "Location.desert": [ ],
  • "Location.direction": [ ],
  • "Location.government_residence": [
    ],
  • "Location.highway": [ ],
  • "Location.lake": [ ],
  • "Location.language": [ ],
  • "Location.lighthouse": [ ],
  • "Location.mountain": [ ],
  • "Location.mountain_range": [ ],
  • "Location.museum_or_gallery": [
    ],
  • "Location.neighborhood": [ ],
  • "Location.ocean": [ ],
  • "Location.park": [ ],
  • "Location.power_station": [
    ],
  • "Location.prison": [
    ],
  • "Location.public_space": [ ],
  • "Location.region": [ ],
  • "Location.religious_site": [
    ],
  • "Location.river": [ ],
  • "Location.sea": [ ],
  • "Location.stadium": [
    ],
  • "Location.state_or_province": [ ],
  • "Location.statue": [ ],
  • "Location.train_station": [
    ],
  • "Location.transit_line": [
    ],
  • "Location.university": [
    ],
  • "Location.waterfall": [ ],
  • "Number.financials": [
    ],
  • "Number.math_constant": [
    ],
  • "Org.broadcaster": [ ],
  • "Org.business": [
    ],
  • "Org.central_bank": [
    ],
  • "Org.college_sports_team": [
    ],
  • "Org.government_agency": [
    ],
  • "Org.government_committee": [
    ],
  • "Org.government_legislature": [
    ],
  • "Org.hackers": [
    ],
  • "Org.hospital": [
    ],
  • "Org.ideology": [
    ],
  • "Org.intelligence_agency": [
    ],
  • "Org.junior_hockey_team": [
    ],
  • "Org.militants": [
    ],
  • "Org.military": [
    ],
  • "Org.minor_league_baseball_team": [
    ],
  • "Org.music_group": [
    ],
  • "Org.news_agency": [ ],
  • "Org.newspaper": [ ],
  • "Org.nonprofit": [ ],
  • "Org.online_news": [ ],
  • "Org.political_party": [
    ],
  • "Org.pro_baseball_team": [
    ],
  • "Org.pro_basketball_team": [
    ],
  • "Org.pro_football_team": [
    ],
  • "Org.pro_hockey_team": [
    ],
  • "Org.pro_rugby_team": [
    ],
  • "Org.pro_soccer_team": [
    ],
  • "Org.radio_station": [
    ],
  • "Org.religion": [
    ],
  • "Org.sports_league": [
    ],
  • "Org.stock_exchange": [
    ],
  • "Org.stock_index": [
    ],
  • "Org.transit_authority": [ ],
  • "Org.transit_system": [ ],
  • "Person.academic": [ ],
  • "Person.actor": [
    ],
  • "Person.artist": [
    ],
  • "Person.author": [
    ],
  • "Person.broadcaster": [ ],
  • "Person.businessman": [
    ],
  • "Person.comedian": [
    ],
  • "Person.computer_scientist": [
    ],
  • "Person.criminal": [
    ],
  • "Person.director": [
    ],
  • "Person.economist": [
    ],
  • "Person.fictional_character": [
    ],
  • "Person.first_lady": [
    ],
  • "Person.first_nations": [ ],
  • "Person.government_employee": [
    ],
  • "Person.hacker": [
    ],
  • "Person.head_of_state_title": [
    ],
  • "Person.journalist": [ ],
  • "Person.judge": [
    ],
  • "Person.lawyer": [
    ],
  • "Person.military_personnel": [
    ],
  • "Person.military_rank": [
    ],
  • "Person.model": [ ],
  • "Person.music_group": [
    ],
  • "Person.musician": [
    ],
  • "Person.nationality": [ ],
  • "Person.philanthropist": [ ],
  • "Person.philosopher": [
    ],
  • "Person.physician": [
    ],
  • "Person.playwright": [
    ],
  • "Person.poet": [
    ],
  • "Person.politician": [
    ],
  • "Person.pro_athlete": [
    ],
  • "Person.radio_host": [
    ],
  • "Person.relationship": [ ],
  • "Person.religious_figure": [
    ],
  • "Person.religious_follower": [
    ],
  • "Person.religious_founder": [
    ],
  • "Person.royalty": [
    ],
  • "Person.scientist": [
    ],
  • "Person.software_engineer": [
    ],
  • "Person.sports_coach": [
    ],
  • "Person.sports_position": [
    ],
  • "Person.surgeon": [
    ],
  • "Person.terrorist": [
    ],
  • "Person.tv_presenter": [ ],
  • "Person.us_president": [
    ],
  • "Person.whistleblower": [ ],
  • "Person.world_leader": [
    ],
  • "Product.airplane": [ ],
  • "Product.album": [
    ],
  • "Product.automobile": [
    ],
  • "Product.beer": [
    ],
  • "Product.book": [
    ],
  • "Product.cargo_ship": [
    ],
  • "Product.coffee": [
    ],
  • "Product.commodity": [
    ],
  • "Product.cryptocurrency": [
    ],
  • "Product.currency": [
    ],
  • "Product.digital_media_player": [
    ],
  • "Product.financial": [
    ],
  • "Product.food": [
    ],
  • "Product.headphones": [
    ],
  • "Product.laundry_detergent": [ ],
  • "Product.magazine": [ ],
  • "Product.military_ship": [
    ],
  • "Product.mobile_phone": [
    ],
  • "Product.movie": [
    ],
  • "Product.music_genre": [
    ],
  • "Product.musical_instrument": [
    ],
  • "Product.pipeline_system": [
    ],
  • "Product.podcast": [ ],
  • "Product.smartphone": [
    ],
  • "Product.soft_drink": [
    ],
  • "Product.tablet": [
    ],
  • "Product.tea": [
    ],
  • "Product.tv_episode": [
    ],
  • "Product.tv_show": [
    ],
  • "Product.video_game": [
    ],
  • "Product.video_game_console": [
    ],
  • "Product.weapon": [
    ],
  • "Product.wine": [
    ],
  • "Science.amphibian": [
    ],
  • "Science.bird": [
    ],
  • "Science.chemical_compound": [
    ],
  • "Science.chemical_element": [
    ],
  • "Science.fish": [
    ],
  • "Science.galaxy": [
    ],
  • "Science.insect": [
    ],
  • "Science.mammal": [
    ],
  • "Science.planet": [
    ],
  • "Science.plant": [
    ],
  • "Science.reptile": [
    ],
  • "Science.star": [
    ],
  • "Technology.algorithm": [
    ],
  • "Technology.component": [
    ],
  • "Technology.cpu_architecture": [
    ],
  • "Technology.cpu_extensions": [
    ],
  • "Technology.file_format": [
    ],
  • "Technology.infotainment": [
    ],
  • "Technology.mobile_interface": [
    ],
  • "Technology.network": [
    ],
  • "Technology.operating_system": [
    ],
  • "Technology.programming_language": [
    ],
  • "Technology.social_network": [
    ],
  • "Technology.software": [
    ],
  • "Technology.software_development_process": [
    ],
  • "Technology.software_license": [
    ],
  • "Technology.streaming_service": [
    ],
  • "Technology.typeface": [
    ],
  • "Time.day": [ ],
  • "Time.holiday": [ ],
  • "Time.month": [ ],
  • "Time.season": [ ],
  • "status": "OK"
}

Text similarity

Calculate the semantic similarity, between 0 and 1, of two pieces of text in any language. Subject matter, entities, sentiment and entity metadata all play a factor in computing the semantic similarity

Request
path Parameters
apikey
required
string

Valid API key for your account

Request Body schema: multipart/form-data
text1
string

One of the blocks of text you'd like to compare for semantic similarity

text2
string

The other block of text you'd like to compare for semantic similarity

lang1
string

The two letter code of the language of the text in text1. If omitted, english is assumed.

lang2
string

The two letter code of the language of the text in text2. If omitted, english is assumed.

Responses
200

OK

post/{apikey}/similar.json
Request samples
curl -d "text1=Lowry and Siakam combined for 60 points in the Raps 101-85 win over the Cavs on Sunday&text2=LeBron James is excited about playing with Anthony Davis this year." \
https://api.repustate.com/v4/{apikey}/similar.json
Response samples
application/json
{
  • "score": 0,
  • "status": "OK"
}