Optimize a memory-intensive data transformation script that processes large JSON payloads from model inference responses.
Implement transform_responses(chunks), where chunks is a list of strings whose concatenation is a JSON array. Return one dictionary per response with its id and the concatenation of all text values in its output array. Process the input incrementally rather than parsing the complete payload with one large json.loads call.
chunks is a list of strings. Return a list of dictionaries in input order, with keys id and text.
def transform_responses(chunks):