Back to problems

Word Level Match and Tagging

Algorithm · Harvey · Hard

Problem Description Given a model_response string and a list of sources, process the text in three stages: Part 1 For every item in sources, determine its match count and return all counts as a list. Part 2 Mark the portions of model_response that correspond to matched sources. Part 3 Using the marked text, insert citations in the format tagged content [1][0]. Arrange the citations from the most frequently cited source to the least frequently cited source. Matching is…

Checking your access…