def test_relevance(self):
     test_data = 'president'
     test_query = ['president', "prime minister"]
     response = relevance(test_data, test_query)
     self.assertTrue(isinstance(response, list))
     self.assertTrue(response[0] > 0.5)
     self.assertTrue(response[1] > 0.3)
     self.assertEqual(len(response), 2)
Beispiel #2
0
 def test_relevance(self):
     test_data = 'president'
     test_query = ['president', "prime minister"]
     response = relevance(test_data, test_query)
     self.assertTrue(isinstance(response, np.ndarray))
     self.assertTrue(response[0] > 0.5)
     self.assertTrue(response[1] > 0.2)
     self.assertEqual(len(response), 2)
Beispiel #3
0
 def test_batch_relevance(self):
     test_data = ['president', 'president']
     test_query = ['president', "prime minister"]
     response = relevance(test_data, test_query)
     self.assertTrue(isinstance(response, list))
     self.assertTrue(response[0][0] > 0.5)
     self.assertTrue(response[0][1] > 0.3)
     self.assertEqual(len(response), 2)
     self.assertEqual(len(response[0]), 2)
     self.assertEqual(len(response[1]), 2)
Beispiel #4
0
def parse(message, number):
	store(message, number)
	userProf = analyzeUser(number)

	if comparePrev(message, number):
		return "Message Sent"
	else:
		ent = entityMatch(message)
		if  ent == "None":
			print "keywords"
			print indicoio.keywords(message, version=2)
			print "tags"
			print indicoio.text_tags(message, threshold = .03)
			print "relevance"
			print indicoio.relevance("Renowned soccer legend Pele will be visiting...", ["Germany", "relocation", "Food", "Safety", "Family", "Transportation", "clothing"])

		else:
			"Found Entity, directing there"
			ticketCreate(message, number, ent)
 def test_batch_relevance(self):
     test_data = ['president', 'president']
     test_query = ['president', "prime minister"]
     response = relevance(test_data, test_query)
     self.assertTrue(isinstance(response, np.ndarray))
     self.assertTrue(response[0][0] > 0.5)
     self.assertTrue(response[0][1] > 0.2)
     self.assertEqual(len(response), 2)
     self.assertEqual(len(response[0]), 2)
     self.assertEqual(len(response[1]), 2)
def job_matcher(job_desc, resume):
    return indicoio.relevance(list(summarizer(resume)), analyzer(job_desc))
Beispiel #7
0
import indicoio
import operator



indicoio.config.api_key = 'b94312524aff44f47c4cc57b9e56c5e6'

# single example
#print indicoio.keywords("Where do I get food in Lesbos?", version=2)
#returns the words that are deemed most relevant
print indicoio.relevance("Where do I get food in Lesbos?", ["food", "general_food"]) 
#returns list of proportions representing how relevant the word is to the string
keyword_dictionary = indicoio.text_tags("Where do I get food in Lesbos?")
top_word = max(keyword_dictionary.iteritems(), key=operator.itemgetter(1))[0]
keyword_dictionary.pop(top_word)
second_top_word = 




# batch example
#print indicoio.keywords([
#    "How do I get water nearby?",
#    "Where did my family go?"
#], version=2)
#returns the words that are deemed most relevant
#print indicoio.relevance(["How do I get water nearby?", "Where did my family go?"], ["family"])
#returns list of proportions representing how relevant the word is to the string
#print indicoio.text_tags([
#    "The most common form of arrow consists of a shaft with an arrowhead attached to the front end and with fletchings and a nock attached to the other end.",
#    "Yoga in Indian traditions, however, is more than physical exercise, it has a meditative and spiritual core."