MCPcopy Index your code
hub / github.com/geekcomputers/Python / predict

Method predict

AutoComplete_App/backend.py:129–145  ·  view source on GitHub ↗

Returns - string Input - string ---------- Returns the completion word of the input word - takes in a word - retrieves the predictions map - returns the completion word of the input word

(self, word)

Source from the content-addressed store, hash-verified

127 return "training complete"
128
129 def predict(self, word):
130 """
131 Returns - string
132 Input - string
133 ----------
134 Returns the completion word of the input word
135 - takes in a word
136 - retrieves the predictions map
137 - returns the completion word of the input word
138 """
139 cur = self.conn.cursor()
140 predictions = cur.execute(
141 "SELECT value FROM WordPrediction WHERE name='predictions'"
142 ).fetchone()[0]
143 predictions = json.loads(predictions)
144 completion_word = predictions[word.lower()]["completion_word"]
145 return completion_word
146
147
148if __name__ == "__main__":

Callers 4

predict_wordFunction · 0.95
backend.pyFile · 0.80
mask_detection.pyFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected