Skip to content

Conversation

@anjalix24
Copy link

Issue

The system was identifying gender incorrectly when the user entered text like:

"I am a woman entrepreneur"

Cause

The substring "man" inside "woman" caused false gender detection due to .includes() matching behavior.

Fix

  • Prioritized female keywords before male keywords.
  • Replaced substring matching logic with word-boundary regex to avoid partial matches.

Testing

Confirmed correct detection for:

  • "woman entrepreneur" → female
  • "male small business owner" → male
  • "girl applying for loan" → female
  • "businessman" → male
  • neutral text (no gender terms) → unknown

@vercel
Copy link

vercel bot commented Dec 5, 2025

@anjalix24 is attempting to deploy a commit to the eccentriccoder01's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions
Copy link

github-actions bot commented Dec 5, 2025

Thanks for creating a PR for your Issue! ☺️

We'll review it as soon as possible.
In the meantime, please double-check the file changes and ensure that all commits are accurate.

If there are any unresolved review comments, feel free to resolve them. 🙌🏼

@anjalix24
Copy link
Author

anjalix24 commented Dec 8, 2025

Fix

  • Prioritized female keywords (woman, girl, etc.) before male.
  • Switched to word-boundary regex for keyword matching.

Testing

Tested locally with:

  • "I am a woman entrepreneur" → female
  • "I am a male entrepreneur" → male
  • "I am a girl starting a shop" → female
  • "businessman" → male
  • No gender words → unknown

fixed #356 ready to merge!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant