I have a bunch of reviews:

User_id, review
1, "We (a family of 4 adults) chose this and view and loved this place"
1, "My husband and I, with our 2 teen sons, visit this restaurant at least once..."
2,"My partner and I booked table for a short holiday, their wine menu was awesome"
2,"My wife is a fan of jazz and she's expecting, so visited this place "

What techniques/packages are available to, for instance, estimate that:

User Id 1 => family of 4, 2 sons (13-19)
User Id 2 => family of 2, expecting

I have been googling around, to little help, and other than creating my own labeled dataset, I was hoping there are some NLP techniques that can help bootstrap my training set, which can then be curated by humans.


1 Answer 1


I can think of two options:

  • Train a custom supervised tagger for your data, typically with a sequence labeling method such as CRF. This will require a quite large amount of annotated data (and a specific formatting), but if done well it should give you quite accurate results.
  • Use manually defined patterns based on keywords (such as "My * and I", "family", "friends") directly associated with a predefined category, and match these patterns in the data. You can do several iterations of defining new patterns for cases that are not matched, thus refining progressively. Depending on your data and how far you go with this you should be able to correctly match most cases, possibly reaching as good accuracy as a tagger for much less work.

Btw be careful how you represent your data: the same user id might not always give you the same group of people since they can go to a restaurant one day with their family, the next day with their wife, the day after with their mistress, etc. Also a "family of 2, expecting" usually becomes "a family of 3" after 9 months ;)


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.