We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
def classify_mouse(sentence):
words = set(sentence.lower().split()) # Tokenize and convert to set
comp_score = sum(word in computer_mouse_words for word in words)
animal_score = sum(word in animal_mouse_words for word in words)
return "computer-mouse" if comp_score > animal_score else "animal"
Read input
n = int(sys.stdin.readline().strip()) # Number of sentences
for _ in range(n):
sentence = sys.stdin.readline().strip()
print(classify_mouse(sentence))
USTED tiene toda la razón, hay muchas oficinas y póquer en lÃnea u otros juegos de apuestas, asà como formas de poner software en su sitio web para abrir un nuevo mira aquà , pero sigue siendo genial ya que permite que toda la industria se desarrolle y le brinda al usuario ¡una opción para los juegos en los juegos más atractivos!
I went to the following naïve design:
Build a two sets of tokens from wikipedia from both computer-mouse and animal mouse pages
Remove from intersection tokens from both sets
Then, tokenise input query and count tokens belonging to the animal mouse or computer mouse set
Then return the concept having the highest count
Enter your code here. Read input from STDIN. Print output to STDOUT
import sys
Predefined word lists
computer_mouse_words = { "computer", "device", "keyboard", "input", "usb", "wireless", "click", "scroll", "right-click", "left-click", "sensor", "dpi", "bluetooth" }
animal_mouse_words = { "tail", "fur", "whiskers", "rodent", "nest", "trap", "cheese", "mammal", "predator", "wild", "burrow", "nocturnal", "prey" }
def classify_mouse(sentence): words = set(sentence.lower().split()) # Tokenize and convert to set comp_score = sum(word in computer_mouse_words for word in words) animal_score = sum(word in animal_mouse_words for word in words)
Read input
n = int(sys.stdin.readline().strip()) # Number of sentences for _ in range(n): sentence = sys.stdin.readline().strip() print(classify_mouse(sentence))
USTED tiene toda la razón, hay muchas oficinas y póquer en lÃnea u otros juegos de apuestas, asà como formas de poner software en su sitio web para abrir un nuevo mira aquà , pero sigue siendo genial ya que permite que toda la industria se desarrolle y le brinda al usuario ¡una opción para los juegos en los juegos más atractivos!
Hi,
I went to the following naïve design: Build a two sets of tokens from wikipedia from both computer-mouse and animal mouse pages Remove from intersection tokens from both sets
Then, tokenise input query and count tokens belonging to the animal mouse or computer mouse set Then return the concept having the highest count
M
Newbie asking for help. how would you do that.
Where did you guys get the training data?