<jupyter_start><jupyter_text>Test NLP deployment<jupyter_code>import requests
import oci
from oci.signer import Signer

import json
import pandas as pd
import numpy as np
ENDPOINT = "https://modeldeployment.eu-frankfurt-1.oci.customer-oci.com/ocid1.datasciencemodeldeployment.oc1.eu-frankfurt-1.amaaaaaangencdya3d3aajpwgvvpbcmvaacdvroq4td6vvvd3g7w4rj3ce2a/predict"
print(ENDPOINT)
# again using RP
rps = oci.auth.signers.get_resource_principals_signer()

# payload goes here
body = 'La vostra azienda offre servizi inadeguati'

print("These are the predictions from the deployed model:")
print(requests.post(ENDPOINT, json=body, auth=rps).json())
print()<jupyter_output>These are the predictions from the deployed model:
[{'label': '1 star', 'score': 0.1397}, {'label': '2 star', 'score': 0.146}, {'label': '3 star', 'score': 0.2166}, {'label': '4 star', 'score': 0.2406}, {'label': '5 star', 'score': 0.2571}]
{'fraction_non_alphanumeric': 0.14175824175824175, 'fraction_numerical': 0.046153846153846156, 'mean_word_length': 6.720338983050848, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '337477', 'license': 'MIT', 'n_tokens_mistral': 355, 'n_tokens_neox': 336, 'n_words': 82, 'path': '.ipynb_checkpoints/test_deployment-checkpoint.ipynb', 'repo_name': 'luigisaetta/italian-sentiment-analysis', 'size': '910'}