General models:
Image Recognition
This is a general model for image recognition
for more information on Image Recognition, please check
Docs: Image Recognition
Get model:
# Get the model you want to use
# models.get function returns an instance of the model
model = app.models.get('ImageRecognition')
predict_by_url
# model.predict_by_url(<image_url>)
model.predict_by_url('https://upload.wikimedia.org/wikipedia/commons/6/6e/Golde33443.jpg')
predict_by_imagefile
# model.predict_by_imagefile(<full_path_to_image_file>)
model.predict_by_imagefile('/home/user/dog.jpg')
Sentiment Analysis
This is a v1 general model for text sentiment analysis.
for more information on Sentiment Analysis, please check
Docs: Sentiment Analysis
Get model:
# Get the model you want to use
# models.get function returns an instance of the model
model = app.models.get('SentimentAnalysis')
analyze_text
# Use the available methods to make a prediction
model.analyze_text('I love cognious because of it's simplicity.')
# You can also pass a list of texts
model.analyze_text(['I love cognious because of it's simplicity.', 'This is good'])
analyze_each_sentence
# Use the available methods to make a prediction
model.analyze_each_sentence('Future climate change and associated impacts will differ from region to region around the globe. Anticipated effects include increasing global temperatures, rising sea levels, changing precipitation, and expansion of deserts in the subtropics. Warming is expected to be greater over land than over the oceans and greatest in the Arctic, with the continuing retreat of glaciers, permafrost and sea ice. Other likely changes include more frequent extreme weather events such as heat waves, droughts, heavy rainfall with floods and heavy snowfall; ocean acidification; and species extinctions due to shifting temperature regimes. Effects significant to humans include the threat to food security from decreasing crop yields and the abandonment of populated areas due to rising sea levels. Because the climate system has a large "inertia" and greenhouse gases will remain in the atmosphere for a long time, many of these effects will persist for not only decades or centuries, but for tens of thousands of years to come.')