In Elman's third experiment a network reads text one letter at a time, with no spaces, and predicts the next letter. Its error is high at the first letter of a word and falls as the rest of the word arrives. Use that error signal to cut a letter stream into words, and score the cuts against the true words.
Implement segment(letters, errors, min_rise=0.0) and boundary_scores(pred_words, true_words).
segment
letters: a string of letters. errors: numbers, where errors[i] is the error the network made when letter was the letter to predict.errors[i] - errors[i-1] > min_rise. Letter always starts the first word.[].boundary_scores
["ab", "c"] the boundaries are .(precision, recall) with precision and recall , each rounded to 4 decimals.(1.0, 1.0). Otherwise an empty denominator gives 0.0.