Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why removing question and answers less than 2 #21

Open
kiruthihan10 opened this issue May 1, 2019 · 0 comments
Open

Why removing question and answers less than 2 #21

kiruthihan10 opened this issue May 1, 2019 · 0 comments

Comments

@kiruthihan10
Copy link

thanks for the code
Though i couldn't understand the purpose of removing questions and answers less than 2 words.
Please explain
`# Remove questions and answers that are shorter than 2 words and longer than 20 words.
min_line_length = 2
max_line_length = 20

Filter out the questions that are too short/long

short_questions_temp = []
short_answers_temp = []

i = 0
for question in clean_questions:
if len(question.split()) >= min_line_length and len(question.split()) <= max_line_length:
short_questions_temp.append(question)
short_answers_temp.append(clean_answers[i])
i += 1

Filter out the answers that are too short/long

short_questions = []
short_answers = []

i = 0
for answer in short_answers_temp:
if len(answer.split()) >= min_line_length and len(answer.split()) <= max_line_length:
short_answers.append(answer)
short_questions.append(short_questions_temp[i])
i += 1`

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

No branches or pull requests

1 participant