CertifaiAI / CertifaiAI/cdle-traininglabs

IndexOutOfBoundsException in PredictGenderTest

Open
#175 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
41
Forks
70
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
`java.lang.IndexOutOfBoundsException` occurs when user input more than 11 characters (space included) in the input field.
Affected in both solution and training folder.

Code that causes this error:
https://github.com/CertifaiAI/cdle-traininglabs/blob/725a6e4e5bf4f58d3bc73d68bd1cd1a09ba9b817/dl4j-labs/src/main/java/ai/certifai/solution/feedforward/detectgender/PredictGenderTest.java#L91-L94

**To Reproduce**
Steps to reproduce the behavior:
1. Go to `dl4j-labs/src/main/java/ai/certifai/solution/feedforward/detectgender/PredictGenderTrain.java`
2. Run the java file to train the model.
3. Go to `dl4j-labs/src/main/java/ai/certifai/solution/feedforward/detectgender/PredictGenderTest.java`
4. Run the java file and enter the name with more than 11 characters in input field.

**Expected behavior**
No error occurs, successfully predict the gender from the name.

**Screenshots**
![image](https://user-images.githubusercontent.com/55592054/130887721-e84dd9e8-a450-4f9b-b076-8ec7d874b2d3.png)

**Desktop:**
- OS: Windows 10 Pro
- Version: 10.0.19042 Build 19042

Contributor guide

No contributing guide indexed for this repository

Research direction

Run PredictGenderTrain.java, then reproduce the failure in PredictGenderTest.java with a name longer than 11 characters. Inspect the linked code at lines 91-94 and compare the corresponding solution and training files. Done means both versions accept longer input and successfully predict the gender without an IndexOutOfBoundsException.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
machine-learning
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.