Beta - Score Lexical Stress & Intonation
This is beta functionality and subject to change.
In this example we evaluate lexical (word) stress and intonation (sentence stress) in a given sentence.
The JSON result includes the following additional Elements:
| Element | Field | Description |
|---|---|---|
| syllablescorelist[] | stress_level | Expected (Correct) lexical stress level based on the Lexicon. Values:
|
| syllablescorelist[] | predictedstresslevel | Detected lexical stress level based on the user audio. Values:
|
| syllablescorelist[] | stress_score | Floating point number between 0 and 100 indicating the correctness of the user's stress level. |
| syllablescorelist[] | pitch_range[] | [beginpitch,endpitch] recorded for this syllable in Hertz. |
| wordintonationlist[] | syllableintonationlist[] | [pitchchangefromprevious, pitchchangeincurrent] pitchchangefrom_previous: indicates whether the pitch of a word rises, falls, or more or less unchanged. If we can’t recognize the syllable (due to error from our side or due to user not saying the syllable), the value is null. If we can recognize the syllable but couldn’t determine the pitch (due to error from our side or due to user reducing the sound to unvoiced), the value is REDUCED. pitchchangein_current: is null unless one of the following cases occurs: If the pitch of the syllable falls, but the starting pitch of the syllable is higher than the ending pitch of previous syllable, secondary intonation is RISE while primary intonation is FALL. If the pitch of the syllable rises, but the starting pitch of the syllable is lower than the ending pitch of the previous syllable, secondary intonation is FALL while primary intonation is RISE. Values:
|
Request Params
| Key | Datatype | Required | Description |
|---|---|---|---|
key | string | API key issued by Speechace. | |
dialect | string | The dialect to use for scoring. Supported values are "en-us" (US English) and "en-gb" (UK English). |
en-gb requires setting v0.1 in url path. i.e. https://api.speechace.co/api/scoring/text/v0.1/json? |
| user_id | string | | A unique anonymized identifier for the end-user who spoke the audio.
Structure this field to include as much info as possible to aid in reporting and analytics.
For example: user_id=XYZ-ABC-99001 where:
- XYZ is an id for your Product or App
- ABC is an id for the customer/site/account
- 99001 is an id for the end-user
Ensure user_id is unique and anonymized containing no personally identifiable information. |
Request Body
[{"name"=>"text", "value"=>"Some parents admire famous athletes as strong role models, so they name their children after them.", "datatype"=>"string"}, {"name"=>"user_audio_file", "value"=>nil, "datatype"=>"null"}, {"name"=>"question_info", "value"=>"'u1/q1'", "datatype"=>"string"}, {"name"=>"include_intonation", "value"=>"1", "datatype"=>"number"}, {"name"=>"stress_version", "value"=>"0.8", "datatype"=>"string"}]
RESPONSES
status: OK
{"status":"success","quota_remaining":-1,"text_score":{"text":"Some parents admire famous athletes as strong role models, so they name their children after them.","quality_score":99,"word_score_list":[{"word":"Some","quality_score":100,"phone_score_list":[{"phone":"s","stress_level":null,"extent":[10,27],"quality_score":99.05882352941177,"sound_most_like":"s"},{"phone":"ah","stress_level":1,"extent":[27,36],"quality_score":100,"stress_score":100,"predicted_stress_level":1,"sound_most_like":"ah"},{"phone":"m","stress_level":null,"extent":[36,42],"quality_score":99.5,"sound_most_like":"m"}],"syllable_score_list":[{"phone_count":3,"stress_level":1,"letters":"some","quality_score":100,"stress_score":100,"intonation":[null,"FALL"],"pitch_range":[243.78,226.7143564356436],"predicted_stress_level":1,"extent":[10,42]}]},{"word":"parents","quality_score":99,"phone_score_list":[{"phone":"p","stress_level":null,"extent":[43,51],"quality_score":100,"sound_most_like":"p"},{"phone":"eh","stress_level":1,"extent":[51,57],"quality_score":100,"stress_score":100,"predicted_stress_level":1,"sound_most_like":"eh"},{"phone":"r","stress_level":null,"extent":[57,66],"quality_score":100,"sound_most_like":"r"},{"phone":"ah","stress_level":0,"extent":[66,69],"quality_score":100,"stress_score":100,"predicted_stress_level":0,"sound_most_like":"ah"},{"phone":"n","stress_level":null,"extent":[69,75],"quality_score":100,"sound_most_like":"n"},{"phone":"t","stress_level":null,"extent":[75,76],"quality_score":94,"sound_most_like":"t"},{"phone":"s","stress_level":null,"extent":[76,84],"quality_score":99.25,"sound_most_like":"s"}],"syllable_score_list":[{"phone_count":2,"stress_level":1,"letters":"pa","quality_score":100,"stress_score":100,"intonation":[null,"FALL"],"pitch_range":[225.71049504950494,211.65643564356435],"predicted_stress_level":1,"extent":[43,57]},{"phone_count":5,"stress_level":0,"letters":"rents","quality_score":99,"stress_score":100,"intonation":[null,"FALL"],"pitch_range":[211.65643564356435,184.5521782178218],"predicted_stress_level":0,"extent":[57,84]}]},{"word":"admire","quality_score":99,"phone_score_list":[{"phone":"ah","stress_level":0,"extent":[85,90],"quality_score":96.4,"stress_score":100,"predicted_stress_level":0,"sound_most_like":"ah"},{"phone":"d","stress_level":null,"extent":[90,93],"quality_score":100,"sound_most_like":"d"},{"phone":"m","stress_level":null,"extent":[93,102],"quality_score":100,"sound_most_like":"m"},{"phone":"ay","stress_level":1,"extent":[102,117],"quality_score":99.8,"stress_score":100,"predicted_stress_level":1,"sound_most_like":"ay"},{"phone":"er","stress_level":0,"extent":[117,129],"quality_score":99,"stress_score":100,"predicted_stress_level":0,"sound_most_like":"er"}],"syllable_score_list":[{"phone_count":2,"stress_level":0,"letters":"ad","quality_score":98,"stress_score":100,"intonation":[null,"FALL"],"pitch_range":[183.54831683168317,175.51742574257423],"predicted_stress_level":0,"extent":[85,93]},{"phone_count":2,"stress_level":1,"letters":"mi","quality_score":100,"stress_score":100,"intonation":[null,"FALL"],"pitch_range":[175.51742574257423,151.42475247524752],"predicted_stress_level":1,"extent":[93,117]},{"phone_count":1,"stress_level":0,"letters":"re","quality_score":99,"stress_score":100,"intonation":["FALL","RISE"],"pitch_range":[146.53,150.24870967741936],"predicted_stress_level":0,"extent":[117,129]}]},{"word":"famous","quality_score":98,"phone_score_list":[{"phone":"f","stress_level":null,"extent":[130,141],"quality_score":99.0909090909091,"sound_most_like":"f"},{"phone":"ey","stress_level":1,"extent":[141,150],"quality_score":100,"stress_score":100,"predicted_stress_level":1,"sound_most_like":"ey"},{"phone":"m","stress_level":null,"extent":[150,156],"quality_score":100,"sound_most_like":"m"},{"phone":"ah","stress_level":0,"extent":[156,162],"quality_score":95.5,"stress_score":100,"predicted_stress_level":0,"sound_most_like":"ah"},{"phone":"s","stress_level":null,"extent":[162,174],"quality_score":95.5,"sound_most_like":"s"}],"syllable_score_list":[{"phone_count":2,"stress_level":1,"letters":"fa","quality_score":100,"stress_score":100,"intonation":[null,"RISE"],"pitch_range":[152.10806451612905,189.29516129032257],"predicted_stress_level":1,"extent":[130,150]},{"phone_count":3,"stress_level":0,"letters":"mous","quality_score":97,"stress_score":100,"intonation":[null,"FALL"],"pitch_range":[182.4,181.18846153846155],"predicted_stress_level":0,"extent":[150,174]}]},{"word":"athletes","quality_score":98,"phone_score_list":[{"phone":"ae","stress_level":1,"extent":[175,186],"quality_score":100,"stress_score":100,"predicted_stress_level":1,"sound_most_like":"ae"},{"phone":"th","stress_level":null,"extent":[186,195],"quality_score":96.66666666666667,"sound_most_like":"th"},{"phone":"l","stress_level":null,"extent":[195,204],"quality_score":99.66666666666667,"sound_most_like":"l"},{"phone":"iy","stress_level":2,"extent":[204,213],"quality_score":99.66666666666667,"stress_score":50,"predicted_stress_level":0,"sound_most_like":"iy"},{"phone":"t","stress_level":null,"extent":[213,219],"quality_score":97.5,"sound_most_like":"t"},{"phone":"s","stress_level":null,"extent":[219,222],"quality_score":96,"sound_most_like":"s"}],"syllable_score_list":[{"phone_count":2,"stress_level":1,"letters":"ath","quality_score":98,"stress_score":100,"intonation":[null,"FALL"],"pitch_range":[179.97692307692307,166.65],"predicted_stress_level":1,"extent":[175,195]},{"phone_count":4,"stress_level":2,"letters":"letes","quality_score":98,"stress_score":50,"intonation":["RISE","FALL"],"pitch_range":[179.79,149.73],"predicted_stress_level":0,"extent":[195,222]}]},{"word":"as","quality_score":100,"phone_score_list":[{"phone":"eh","stress_level":1,"extent":[226,234],"quality_score":99.625,"stress_score":100,"predicted_stress_level":1,"sound_most_like":"eh"},{"phone":"z","stress_level":null,"extent":[234,240],"quality_score":100,"sound_most_like":"z"}],"syllable_score_list":[{"phone_count":2,"stress_level":1,"letters":"as","quality_score":100,"stress_score":100,"intonation":["RISE","FALL"],"pitch_range":[161.49500000000012,139.73],"predicted_stress_level":1,"extent":[226,240]}]},{"word":"strong","quality_score":100,"phone_score_list":[{"phone":"s","stress_level":null,"extent":[241,246],"quality_score":100,"sound_most_like":"s"},{"phone":"t","stress_level":null,"extent":[246,252],"quality_score":100,"sound_most_like":"t"},{"phone":"r","stress_level":null,"extent":[252,258],"quality_score":100,"sound_most_like":"r"},{"phone":"ao","stress_level":1,"extent":[258,267],"quality_score":99.33333333333333,"stress_score":100,"predicted_stress_level":0,"sound_most_like":"ao"},{"phone":"ng","stress_level":null,"extent":[267,273],"quality_score":100,"sound_most_like":"ng"}],"syllable_score_list":[{"phone_count":5,"stress_level":1,"letters":"strong","quality_score":100,"stress_score":100,"intonation":[null,"RISE"],"pitch_range":[243.78,237.46],"predicted_stress_level":0,"extent":[241,273]}]},{"word":"role","quality_score":100,"phone_score_list":[{"phone":"r","stress_level":null,"extent":[274,282],"quality_score":99.625,"sound_most_like":"r"},{"phone":"ow","stress_level":1,"extent":[282,291],"quality_score":100,"stress_score":100,"predicted_stress_level":1,"sound_most_like":"ow"},{"phone":"l","stress_level":null,"extent":[291,300],"quality_score":100,"sound_most_like":"l"}],"syllable_score_list":[{"phone_count":3,"stress_level":1,"letters":"role","quality_score":100,"stress_score":100,"intonation":[null,"FALL"],"pitch_range":[188.07181818181817,165.41045454545454],"predicted_stress_level":1,"extent":[274,300]}]},{"word":"models","quality_score":99,"phone_score_list":[{"phone":"m","stress_level":null,"extent":[301,312],"quality_score":98.72727272727273,"sound_most_like":"m"},{"phone":"aa","stress_level":1,"extent":[312,321],"quality_score":100,"stress_score":100,"predicted_stress_level":1,"sound_most_like":"aa"},{"phone":"d","stress_level":null,"extent":[321,327],"quality_score":100,"sound_most_like":"d"},{"phone":"ah","stress_level":0,"extent":[327,333],"quality_score":96,"stress_score":100,"predicted_stress_level":0,"sound_most_like":"ah"},{"phone":"l","stress_level":null,"extent":[333,339],"quality_score":100,"sound_most_like":"l"},{"phone":"z","stress_level":null,"extent":[339,354],"quality_score":100,"sound_most_like":"z"}],"ending_punctuation":",","syllable_score_list":[{"phone_count":2,"stress_level":1,"letters":"mo","quality_score":99,"stress_score":100,"intonation":[null,"FALL"],"pitch_range":[164.53886363636366,147.10704545454544],"predicted_stress_level":1,"extent":[301,321]},{"phone_count":4,"stress_level":0,"letters":"dels","quality_score":99,"stress_score":100,"intonation":[null,"FALL"],"pitch_range":[147.10704545454544,132.29],"predicted_stress_level":0,"extent":[321,354]}]},{"word":"so","quality_score":99,"phone_score_list":[{"phone":"s","stress_level":null,"extent":[391,408],"quality_score":99.29411764705883,"sound_most_like":"s"},{"phone":"ow","stress_level":1,"extent":[408,414],"quality_score":99.5,"stress_score":100,"predicted_stress_level":1,"sound_most_like":"ow"}],"syllable_score_list":[{"phone_count":2,"stress_level":1,"letters":"so","quality_score":99,"stress_score":100,"intonation":[null,"RISE"],"pitch_range":[155.17,155.91578947368419],"predicted_stress_level":1,"extent":[391,414]}]},{"word":"they","quality_score":99,"phone_score_list":[{"phone":"dh","stress_level":null,"extent":[415,420],"quality_score":100,"sound_most_like":"dh"},{"phone":"ey","stress_level":1,"extent":[420,429],"quality_score":98.33333333333333,"stress_score":100,"predicted_stress_level":0,"sound_most_like":"ey"}],"syllable_score_list":[{"phone_count":2,"stress_level":1,"letters":"they","quality_score":99,"stress_score":100,"intonation":[null,"RISE"],"pitch_range":[156.66157894736844,167.10263157894738],"predicted_stress_level":0,"extent":[415,429]}]},{"word":"name","quality_score":99,"phone_score_list":[{"phone":"n","stress_level":null,"extent":[430,435],"quality_score":100,"sound_most_like":"n"},{"phone":"ey","stress_level":1,"extent":[435,444],"quality_score":99.66666666666667,"stress_score":100,"predicted_stress_level":1,"sound_most_like":"ey"},{"phone":"m","stress_level":null,"extent":[444,453],"quality_score":98,"sound_most_like":"m"}],"syllable_score_list":[{"phone_count":3,"stress_level":1,"letters":"name","quality_score":99,"stress_score":100,"intonation":["RISE","FALL"],"pitch_range":[184.86,182.70714285714274],"predicted_stress_level":1,"extent":[430,453]}]},{"word":"their","quality_score":99,"phone_score_list":[{"phone":"dh","stress_level":null,"extent":[454,459],"quality_score":100,"sound_most_like":"dh"},{"phone":"eh","stress_level":1,"extent":[459,465],"quality_score":100,"stress_score":100,"predicted_stress_level":1,"sound_most_like":"eh"},{"phone":"r","stress_level":null,"extent":[465,468],"quality_score":96,"sound_most_like":"r"}],"syllable_score_list":[{"phone_count":3,"stress_level":1,"letters":"their","quality_score":99,"stress_score":100,"intonation":[null,"FALL"],"pitch_range":[180.55428571428564,154.72],"predicted_stress_level":1,"extent":[454,468]}]},{"word":"children","quality_score":99,"phone_score_list":[{"phone":"ch","stress_level":null,"extent":[469,483],"quality_score":98.28571428571429,"sound_most_like":"ch"},{"phone":"ih","stress_level":1,"extent":[483,489],"quality_score":99,"stress_score":100,"predicted_stress_level":1,"sound_most_like":"ih"},{"phone":"l","stress_level":null,"extent":[489,495],"quality_score":100,"sound_most_like":"l"},{"phone":"d","stress_level":null,"extent":[495,498],"quality_score":100,"sound_most_like":"d"},{"phone":"r","stress_level":null,"extent":[498,507],"quality_score":95.66666666666667,"sound_most_like":"r"},{"phone":"ah","stress_level":0,"extent":[507,510],"quality_score":100,"stress_score":100,"predicted_stress_level":0,"sound_most_like":"ah"},{"phone":"n","stress_level":null,"extent":[510,516],"quality_score":100,"sound_most_like":"n"}],"syllable_score_list":[{"phone_count":3,"stress_level":1,"letters":"chil","quality_score":99,"stress_score":100,"intonation":["RISE","FALL"],"pitch_range":[195.11,173.65],"predicted_stress_level":1,"extent":[469,495]},{"phone_count":4,"stress_level":0,"letters":"dren","quality_score":99,"stress_score":100,"intonation":[null,"RISE"],"pitch_range":[180.65125000000003,188.32],"predicted_stress_level":0,"extent":[495,516]}]},{"word":"after","quality_score":100,"phone_score_list":[{"phone":"ae","stress_level":1,"extent":[520,531],"quality_score":99.72727272727273,"stress_score":100,"predicted_stress_level":2,"sound_most_like":"ae"},{"phone":"f","stress_level":null,"extent":[531,540],"quality_score":100,"sound_most_like":"f"},{"phone":"t","stress_level":null,"extent":[540,544],"quality_score":100,"sound_most_like":"t"},{"phone":"er","stress_level":0,"extent":[544,549],"quality_score":98.4,"stress_score":100,"predicted_stress_level":0,"sound_most_like":"er"}],"syllable_score_list":[{"phone_count":2,"stress_level":1,"letters":"af","quality_score":100,"stress_score":100,"intonation":["FALL","RISE"],"pitch_range":[154.13,164.84875000000002],"predicted_stress_level":2,"extent":[520,540]},{"phone_count":2,"stress_level":0,"letters":"ter","quality_score":99,"stress_score":100,"intonation":[null,"FALL"],"pitch_range":[164.7,158.60151515151512],"predicted_stress_level":0,"extent":[540,549]}]},{"word":"them","quality_score":100,"phone_score_list":[{"phone":"dh","stress_level":null,"extent":[550,555],"quality_score":100,"sound_most_like":"dh"},{"phone":"eh","stress_level":1,"extent":[555,564],"quality_score":100,"stress_score":100,"predicted_stress_level":1,"sound_most_like":"eh"},{"phone":"m","stress_level":null,"extent":[564,582],"quality_score":100,"sound_most_like":"m"}],"ending_punctuation":".","syllable_score_list":[{"phone_count":3,"stress_level":1,"letters":"them","quality_score":100,"stress_score":100,"intonation":[null,"FALL"],"pitch_range":[157.73030303030302,135.95],"predicted_stress_level":1,"extent":[550,582]}]}],"word_intonation_list":[{"word":"Some","syllable_intonation_list":[[null,"FALL"]]},{"word":"parents","syllable_intonation_list":[[null,"FALL"],[null,"FALL"]]},{"word":"admire","syllable_intonation_list":[[null,"FALL"],[null,"FALL"],["FALL","RISE"]]},{"word":"famous","syllable_intonation_list":[[null,"RISE"],[null,"FALL"]]},{"word":"athletes","syllable_intonation_list":[[null,"FALL"],["RISE","FALL"]]},{"word":"as","syllable_intonation_list":[["RISE","FALL"]]},{"word":"strong","syllable_intonation_list":[[null,"RISE"]]},{"word":"role","syllable_intonation_list":[[null,"FALL"]]},{"word":"models","syllable_intonation_list":[[null,"FALL"],[null,"FALL"]]},{"word":"so","syllable_intonation_list":[[null,"RISE"]]},{"word":"they","syllable_intonation_list":[[null,"RISE"]]},{"word":"name","syllable_intonation_list":[["RISE","FALL"]]},{"word":"their","syllable_intonation_list":[[null,"FALL"]]},{"word":"children","syllable_intonation_list":[["RISE","FALL"],[null,"RISE"]]},{"word":"after","syllable_intonation_list":[["FALL","RISE"],[null,"FALL"]]},{"word":"them","syllable_intonation_list":[[null,"FALL"]]}],"fidelity_class":"CORRECT"},"version":"0.5"}