Text this: Optimal resource allocation