JokesManager.ipynb

In [1]:
from xv.english.fun import JokesManager
In [2]:
ke = JokesManager()
In [3]:
ke.printProblemTypes()
0. _problem_fill_in_the_blanks_question
1. _problem_interchanged_words
2. _problem_put_letters_in_order
3. _problem_put_sentence_in_order
4. _problem_put_paragraph_in_order
5. _problem_insert_a_sentence
In [4]:
ke.getRandomProblem(problem_type = 0)
Out[4]:
Fill in the blanks with the given words. Change the form of words if necessary.
with, into, from, for
A boy read a restaurant sign that advertised fat-free French fries.
"Sounds great," said the health-conscious boy. He ordered some.
He watched as the cook pulled a basket of fries __________ the fryer. The potatoes were dripping __________ oil when the cook put them __________ the container.
"Wait a minute," the boy said. "Those don't look fat-free."
"Sure they are," the cook said. "We charge only __________ the potatoes. The fat is free!"
with, into, from, for
In [5]:
ke.printAnswer()
Out[5]:
A boy read a restaurant sign that advertised fat-free French fries.
"Sounds great," said the health-conscious boy. He ordered some.
He watched as the cook pulled a basket of fries from the fryer. The potatoes were dripping with oil when the cook put them into the container.
"Wait a minute," the boy said. "Those don't look fat-free."
"Sure they are," the cook said. "We charge only for the potatoes. The fat is free!"
In [6]:
ke.printSolution()
Out[6]:
A boy read a restaurant sign that advertised fat-free French fries.
"Sounds great," said the health-conscious boy. He ordered some.
He watched as the cook pulled a basket of fries from the fryer. The potatoes were dripping with oil when the cook put them into the container.
"Wait a minute," the boy said. "Those don't look fat-free."
"Sure they are," the cook said. "We charge only for the potatoes. The fat is free!"
In [ ]:
 
In [7]:
from IPython.display import HTML
n = len(ke._problemTemplates)
max_loop = 1
for j in range(0, max_loop):
    for i in range(n):
        problem_type = i
        display(HTML(f"<h2>problem_type: {problem_type}/{n-1} (loop {j}/{max_loop-1})</h2>"))
        ke.getRandomProblem(problem_type = problem_type, verbose = True)
        display(ke.printProblem())

        display(HTML(f"<h6>Answer:</h6>"))
        display(ke.printAnswer())

        display(HTML(f"<h6>Solution:</h6>"))
        display(ke.printSolution())
        pass

problem_type: 0/5 (loop 0/0)

Problem Template: _problem_fill_in_the_blanks_question
Fill in the blanks with the given words. Change the form of words if necessary.
you, we, me, he
A guy walks into the local welfare office, marches straight up to the counter and says, "Hi . . __________ know what, I just HATE drawing welfare I would really rather have a job." The social worker behind the counter says, "Your timing is excellent. __________ just got a job opening from a very wealthy old man who wants a chauffeur / bodyguard for his 18-year-old nymphomaniac daughter. __________ will have to drive around in his Mercedes, and __________'ll supply all of your clothes. Because of the long hours, meals will be provided. __________'ll be expected to escort her on her overseas holiday trips. __________'ll have an adjoining room. The starting salary is \$200,000 a year." The guy says, "You're bullshitting __________!" The social worker says, "Yeah, well, you started it."
you, we, me, he
Answer:
A guy walks into the local welfare office, marches straight up to the counter and says, "Hi . . You know what, I just HATE drawing welfare I would really rather have a job." The social worker behind the counter says, "Your timing is excellent. We just got a job opening from a very wealthy old man who wants a chauffeur / bodyguard for his 18-year-old nymphomaniac daughter. You will have to drive around in his Mercedes, and he'll supply all of your clothes. Because of the long hours, meals will be provided. You'll be expected to escort her on her overseas holiday trips. You'll have an adjoining room. The starting salary is \$200,000 a year." The guy says, "You're bullshitting me!" The social worker says, "Yeah, well, you started it."
Solution:
A guy walks into the local welfare office, marches straight up to the counter and says, "Hi . . You know what, I just HATE drawing welfare I would really rather have a job." The social worker behind the counter says, "Your timing is excellent. We just got a job opening from a very wealthy old man who wants a chauffeur / bodyguard for his 18-year-old nymphomaniac daughter. You will have to drive around in his Mercedes, and he'll supply all of your clothes. Because of the long hours, meals will be provided. You'll be expected to escort her on her overseas holiday trips. You'll have an adjoining room. The starting salary is \$200,000 a year." The guy says, "You're bullshitting me!" The social worker says, "Yeah, well, you started it."

problem_type: 1/5 (loop 0/0)

Problem Template: _problem_interchanged_words
The words have been interchanged. Please put them in proper places.
potatoes, bottles, loaves, cameras
When I was a boy, my momma would send me down to a corner store with \$1 and I'd come back with 5 potatoes, 2 cameras of bread, 3 loaves of milk, a hunk of cheese, a box of tea and 6 eggs. You can't do that now. Too many security bottles.
potatoes, bottles, loaves, cameras
Answer:
When I was a boy, my momma would send me down to a corner store with \$1 and I'd come back with 5 potatoes, 2 loaves of bread, 3 bottles of milk, a hunk of cheese, a box of tea and 6 eggs. You can't do that now. Too many security cameras.
Solution:
When I was a boy, my momma would send me down to a corner store with \$1 and I'd come back with 5 potatoes, 2 loaves of bread, 3 bottles of milk, a hunk of cheese, a box of tea and 6 eggs. You can't do that now. Too many security cameras.

problem_type: 2/5 (loop 0/0)

Problem Template: _problem_put_letters_in_order
Unscramble the word:
asys

The word has been taken from the following paragraph:
A guy asks a lawyer about his fees.
"I charge \$50 for three questions," the lawyer says.
"That's awfully steep, isn't it?" the guy asks.
"Yes, I suppose so," the lawyer replies. "Now what's your final question?"
Answer:
says
Solution:
says

A guy asks a lawyer about his fees.
"I charge \$50 for three questions," the lawyer says.
"That's awfully steep, isn't it?" the guy asks.
"Yes, I suppose so," the lawyer replies. "Now what's your final question?"

problem_type: 3/5 (loop 0/0)

Problem Template: _problem_put_sentence_in_order
Sort the following into a meaningful sentence:
  1. this parrot
  2. was a
  3. very nasty
  4. parrot
Answer:
This parrot was a very nasty parrot.
Solution:
This parrot was a very nasty parrot.

problem_type: 4/5 (loop 0/0)

Problem Template: _problem_put_paragraph_in_order
Sort the sentences into a meaningful order:
  1. Nearing a bar, she saw a large, disreputable-looking man step outside.
  2. Although the nun very much disapproved of overindulging in drink, she decided that this time, discretion was the better part of valor.
  3. He began walking towards her, clearly swaying as a result of the many drinks he had undoubtedly just consumed.
  4. A nun found herself walking through a questionable neighborhood one night on her way back to the convent.
  5. Suddenly, the man hauled back and punched her in the face.
  6. As she fell back in shock and pain, he threw another punch.
  7. She smiled at him and stepped to the side to pass him.
  8. And another and another.
  9. The last thing she heard before she passed out: "Ya ain't shhho fuckin' tough tonight, arrrrrre ya Batman??"
Answer:
A nun found herself walking through a questionable neighborhood one night on her way back to the convent. Nearing a bar, she saw a large, disreputable-looking man step outside. He began walking towards her, clearly swaying as a result of the many drinks he had undoubtedly just consumed.
Although the nun very much disapproved of overindulging in drink, she decided that this time, discretion was the better part of valor. She smiled at him and stepped to the side to pass him. Suddenly, the man hauled back and punched her in the face. As she fell back in shock and pain, he threw another punch. And another and another.
The last thing she heard before she passed out: "Ya ain't shhho fuckin' tough tonight, arrrrrre ya Batman??"
Solution:
A nun found herself walking through a questionable neighborhood one night on her way back to the convent. Nearing a bar, she saw a large, disreputable-looking man step outside. He began walking towards her, clearly swaying as a result of the many drinks he had undoubtedly just consumed.
Although the nun very much disapproved of overindulging in drink, she decided that this time, discretion was the better part of valor. She smiled at him and stepped to the side to pass him. Suddenly, the man hauled back and punched her in the face. As she fell back in shock and pain, he threw another punch. And another and another.
The last thing she heard before she passed out: "Ya ain't shhho fuckin' tough tonight, arrrrrre ya Batman??"

problem_type: 5/5 (loop 0/0)

Problem Template: _problem_insert_a_sentence
Insert the sentence in the passage below. Use punctuation if needed.
The first guy wishes he was off the island and back home.

Passage
Three guys stranded on a desert island find a magic lantern containing a genie, who grants them each one wish. The second guy wishes the same. The third guy says: 'I'm lonely. I wish my friends were back here.'
Answer:
Three guys stranded on a desert island find a magic lantern containing a genie, who grants them each one wish.
The first guy wishes he was off the island and back home.
The second guy wishes the same. The third guy says: 'I'm lonely. I wish my friends were back here.'
Solution:
Three guys stranded on a desert island find a magic lantern containing a genie, who grants them each one wish.
The first guy wishes he was off the island and back home.
The second guy wishes the same. The third guy says: 'I'm lonely. I wish my friends were back here.'
In [ ]:
 

Machine Learning

  1. Deal Banking Marketing Campaign Dataset With Machine Learning

TensorFlow

  1. Difference Between Scalar, Vector, Matrix and Tensor
  2. TensorFlow Deep Learning Model With IRIS Dataset
  3. Sequence to Sequence Learning With Neural Networks To Perform Number Addition
  4. Image Classification Model MobileNet V2 from TensorFlow Hub
  5. Step by Step Intent Recognition With BERT
  6. Sentiment Analysis for Hotel Reviews With NLTK and Keras
  7. Simple Sequence Prediction With LSTM
  8. Image Classification With ResNet50 Model
  9. Predict Amazon Inc Stock Price with Machine Learning
  10. Predict Diabetes With Machine Learning Algorithms
  11. TensorFlow Build Custom Convolutional Neural Network With MNIST Dataset
  12. Deal Banking Marketing Campaign Dataset With Machine Learning

PySpark

  1. How to Parallelize and Distribute Collection in PySpark
  2. Role of StringIndexer and Pipelines in PySpark ML Feature - Part 1
  3. Role of OneHotEncoder and Pipelines in PySpark ML Feature - Part 2
  4. Feature Transformer VectorAssembler in PySpark ML Feature - Part 3
  5. Logistic Regression in PySpark (ML Feature) with Breast Cancer Data Set

PyTorch

  1. Build the Neural Network with PyTorch
  2. Image Classification with PyTorch
  3. Twitter Sentiment Classification In PyTorch
  4. Training an Image Classifier in Pytorch

Natural Language Processing

  1. Spelling Correction Of The Text Data In Natural Language Processing
  2. Handling Text For Machine Learning
  3. Extracting Text From PDF File in Python Using PyPDF2
  4. How to Collect Data Using Twitter API V2 For Natural Language Processing
  5. Converting Text to Features in Natural Language Processing
  6. Extract A Noun Phrase For A Sentence In Natural Language Processing