I am supposed to extract a bunch of "generally useful" features from a piece of text. Use cases vary, but one could be text categorization.
One thing that springs to mind here of course is the length of a text. But how can I encode this into a feature (or a set of features) which is supposed to have values between 0.0 and 1.0. It's hard to say what texts the code will be run on. Most are probably online news articles, some are wikipedia articles (this for examples is singificantly longer than your standard BBC News article: http://en.wikipedia.org/wiki/Barack_Obama), or we might just have tweets.
If there would be known upper, a simple thing to do would be:
feature_value = text_length/upper_bound
But I don't know the upper bound. I could guess, but then I might have cases where feature_value is larger than 1.0.
Somehow this also seems like a fairly generic problem, to which there are probably good solutions out there. I guess I just don't know where too look. So, any hints would be greatly appreciated!