tensorflow / tensorflow/recommenders
TypeError in FactorizedTopK with StringLookup when candidates dataset has dict structure
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2k
- Forks
- 300
- PR merge metrics
- No merged PRs in 30d
Description
When using tfrs.metrics.FactorizedTopK with a candidate dataset, passing a dataset of dictionaries (e.g., {"movie_title": ...}) causes a TypeError.
The error indicates that StringLookup expects a string tensor but receives a dictionary.
Expected behavior
-
The candidate dataset should be accepted even if it’s in dictionary form (common when using TFDS). The library should either:
-
Automatically extract the correct feature (e.g., "movie_title"), or
-
Provide clearer documentation/examples showing how to preprocess the dataset before passing to FactorizedTopK.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at tfrs.metrics.FactorizedTopK and reproduce the TypeError with a candidate dataset whose elements are dictionaries, noting the interaction with StringLookup. Determine whether dictionary candidates should be accepted or documented as requiring preprocessing, then add coverage or documentation that makes the supported behavior and completion criteria explicit.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, tensorflow
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100