Amazon SageMaker जम्पस्टार्ट टेक्स्ट2टेक्स्ट जनरेशन लार्ज लैंग्वेज मॉडल | के साथ बैच ट्रांसफ़ॉर्म करें अमेज़न वेब सेवाएँ

Amazon SageMaker जम्पस्टार्ट टेक्स्ट2टेक्स्ट जनरेशन लार्ज लैंग्वेज मॉडल | के साथ बैच ट्रांसफ़ॉर्म करें अमेज़न वेब सेवाएँ

आज हमें यह घोषणा करते हुए खुशी हो रही है कि अब आप बैच परिवर्तन कर सकते हैं अमेज़न SageMaker जम्पस्टार्ट Text2Text जनरेशन के लिए बड़े भाषा मॉडल (एलएलएम)। बैच परिवर्तन उन स्थितियों में उपयोगी होते हैं जहां प्रतिक्रियाओं को वास्तविक समय की आवश्यकता नहीं होती है और इसलिए आप बड़े पैमाने पर बड़े डेटासेट के लिए बैच में अनुमान लगा सकते हैं। बैच ट्रांसफ़ॉर्म के लिए, एक बैच जॉब चलाया जाता है जो बैच इनपुट को डेटासेट और पूर्व-प्रशिक्षित मॉडल के रूप में लेता है, और डेटासेट में प्रत्येक डेटा बिंदु के लिए पूर्वानुमान आउटपुट करता है। बैच ट्रांसफ़ॉर्म लागत प्रभावी है क्योंकि वास्तविक समय में होस्ट किए गए एंडपॉइंट्स के विपरीत, जिसमें लगातार हार्डवेयर होता है, बैच ट्रांसफ़ॉर्म क्लस्टर काम पूरा होने पर टूट जाते हैं और इसलिए हार्डवेयर का उपयोग केवल बैच जॉब की अवधि के लिए किया जाता है।

कुछ उपयोग मामलों में, वास्तविक समय या लगभग वास्तविक समय प्रतिक्रियाएँ बनाने के लिए बैच प्रोसेसिंग के लिए वास्तविक समय अनुमान अनुरोधों को छोटे बैचों में समूहीकृत किया जा सकता है। उदाहरण के लिए, यदि आपको कम विलंबता और उच्च थ्रूपुट के साथ डेटा की निरंतर स्ट्रीम को संसाधित करने की आवश्यकता है, तो प्रत्येक अनुरोध के लिए अलग-अलग वास्तविक समय समापन बिंदु को लागू करने के लिए अधिक संसाधनों की आवश्यकता होगी और सभी अनुरोधों को संसाधित करने में अधिक समय लग सकता है क्योंकि प्रसंस्करण क्रमिक रूप से किया जा रहा है . एक बेहतर तरीका यह होगा कि कुछ अनुरोधों को समूहीकृत किया जाए और बैच अनुमान मोड में वास्तविक समय के समापन बिंदु को कॉल किया जाए, जो आपके अनुरोधों को मॉडल के एक फॉरवर्ड पास में संसाधित करता है और वास्तविक समय या निकट-वास्तविक समय में अनुरोध के लिए थोक प्रतिक्रिया लौटाता है। . प्रतिक्रिया की विलंबता इस बात पर निर्भर करेगी कि आप कितने अनुरोधों को एक साथ समूहित करते हैं और उदाहरण मेमोरी आकार, इसलिए आप विलंबता और थ्रूपुट के लिए अपनी व्यावसायिक आवश्यकताओं के अनुसार बैच आकार को ट्यून कर सकते हैं। हम इसे कहते हैं वास्तविक समय बैच अनुमान क्योंकि यह वास्तविक समय प्रतिक्रियाएँ प्रदान करते हुए बैचिंग की अवधारणा को जोड़ता है। वास्तविक समय बैच अनुमान के साथ, आप कम विलंबता और उच्च थ्रूपुट के बीच संतुलन प्राप्त कर सकते हैं, जिससे आप बड़ी मात्रा में डेटा को समय पर और कुशल तरीके से संसाधित करने में सक्षम हो सकते हैं।

टेक्स्ट2टेक्स्ट जेनरेशन मॉडल के लिए जम्पस्टार्ट बैच ट्रांसफॉर्म आपको बैच हाइपरपैरामीटर को पर्यावरण चर के माध्यम से पारित करने की अनुमति देता है जो थ्रूपुट को और बढ़ाता है और विलंबता को कम करता है।

जम्पस्टार्ट आपको मशीन लर्निंग (एमएल) के साथ शुरुआत करने में मदद करने के लिए विभिन्न प्रकार की समस्या के लिए पूर्व-प्रशिक्षित, ओपन-सोर्स मॉडल प्रदान करता है। आप तैनाती से पहले इन मॉडलों को क्रमिक रूप से प्रशिक्षित और ट्यून कर सकते हैं। जंपस्टार्ट समाधान टेम्पलेट भी प्रदान करता है जो सामान्य उपयोग के मामलों के लिए बुनियादी ढांचा स्थापित करता है, और एमएल के लिए निष्पादन योग्य उदाहरण नोटबुक प्रदान करता है अमेज़न SageMaker. आप जम्पस्टार्ट लैंडिंग पृष्ठ के माध्यम से पूर्व-प्रशिक्षित मॉडल, समाधान टेम्पलेट और उदाहरणों तक पहुंच सकते हैं अमेज़ॅन सैजमेकर स्टूडियो. आप सेजमेकर पायथन एसडीके का उपयोग करके जम्पस्टार्ट मॉडल तक भी पहुंच सकते हैं।

इस पोस्ट में, हम प्रदर्शित करते हैं कि अत्याधुनिक पूर्व-प्रशिक्षित का उपयोग कैसे करें text2text FLAN T5 मॉडल बैच परिवर्तन और वास्तविक समय बैच अनुमान के लिए हगिंग फेस से।

समाधान अवलोकन

नोटबुक पूर्व-प्रशिक्षित Text2Text FLAN T5 मॉडल का बैच परिवर्तन दिखा रहा है गले लगना निम्नलिखित में उपलब्ध है गिटहब भंडार. यह नोटबुक हगिंग फेस के डेटा का उपयोग करता है सीएनएन_डेलीमेल सेजमेकर एसडीके का उपयोग करके पाठ सारांशीकरण कार्य के लिए डेटासेट।

बैच परिवर्तन और वास्तविक समय बैच अनुमान को लागू करने के लिए मुख्य चरण निम्नलिखित हैं:

  1. पूर्वापेक्षाएँ सेट करें.
  2. एक पूर्व प्रशिक्षित मॉडल का चयन करें।
  3. मॉडल के लिए कलाकृतियाँ पुनः प्राप्त करें.
  4. बैच ट्रांसफॉर्म जॉब हाइपरपैरामीटर निर्दिष्ट करें।
  5. बैच परिवर्तन के लिए डेटा तैयार करें।
  6. बैच ट्रांसफ़ॉर्म कार्य चलाएँ।
  7. ए का उपयोग करके संक्षेपण का मूल्यांकन करें लाल (रिकॉल-ओरिएंटेड अंडरस्टडी फॉर गिस्टिंग इवैल्यूएशन) स्कोर।
  8. वास्तविक समय बैच अनुमान निष्पादित करें।

पूर्वापेक्षाएँ सेट करें

नोटबुक चलाने से पहले, आपको कुछ प्रारंभिक सेटअप चरण पूरे करने होंगे। आइए सेजमेकर निष्पादन भूमिका सेट करें ताकि उसे आपकी ओर से AWS सेवाएं चलाने की अनुमति मिल सके:

sagemaker_session = Session()
aws_role = sagemaker_session.get_caller_identity_arn()
aws_region = boto3.Session().region_name
sess = sagemaker.Session()

एक पूर्व प्रशिक्षित मॉडल का चयन करें

हम Huggingface-text2text-flan-t5-large मॉडल को डिफ़ॉल्ट मॉडल के रूप में उपयोग करते हैं। वैकल्पिक रूप से, आप जम्पस्टार्ट पर उपलब्ध टेक्स्ट2टेक्स्ट मॉडल की सूची पुनः प्राप्त कर सकते हैं और अपना पसंदीदा मॉडल चुन सकते हैं। यह विधि एक ही नोटबुक का उपयोग करके विभिन्न मॉडल आईडी का चयन करने का एक सीधा तरीका प्रदान करती है। प्रदर्शन उद्देश्यों के लिए, हम हगिंगफेस-टेक्स्ट2टेक्स्ट-फ्लान-टी5-लार्ज मॉडल का उपयोग करते हैं:

model_id, model_version, = ( "huggingface-text2text-flan-t5-large", "*",
)

मॉडल के लिए कलाकृतियाँ पुनः प्राप्त करें

SageMaker के साथ, हम पूर्व-प्रशिक्षित मॉडल पर अनुमान लगा सकते हैं, यहां तक ​​कि नए डेटासेट पर पहले इसे ठीक किए बिना भी। हम पुनः प्राप्त करके शुरू करते हैं deploy_image_uri, deploy_source_uri, तथा model_uri पूर्व-प्रशिक्षित मॉडल के लिए:

inference_instance_type = "ml.p3.2xlarge" # Retrieve the inference docker container uri. This is the base HuggingFace container image for the default model above.
deploy_image_uri = image_uris.retrieve(
region=None,
framework=None, # automatically inferred from model_id
image_scope="inference",
model_id=model_id,
model_version=model_version,
instance_type=inference_instance_type,
) # Retrieve the model uri.
model_uri = model_uris.retrieve(
model_id=model_id, model_version=model_version, model_scope="inference"
) #Create the SageMaker model instance
model = Model(
image_uri=deploy_image_uri,
model_data=model_uri,
role=aws_role,
predictor_cls=Predictor)

बैच ट्रांसफॉर्म जॉब हाइपरपैरामीटर निर्दिष्ट करें

आप बैच ट्रांसफॉर्म जॉब के लिए पर्यावरण चर के रूप में हाइपरपैरामीटर के किसी भी उपसमूह को पास कर सकते हैं। आप इन हाइपरपैरामीटर को JSON पेलोड में भी पास कर सकते हैं। हालाँकि, यदि आप निम्न कोड शो की तरह हाइपरपैरामीटर के लिए पर्यावरण चर सेट कर रहे हैं, तो JSON लाइन पेलोड में व्यक्तिगत उदाहरणों से उन्नत हाइपरपैरामीटर का उपयोग नहीं किया जाएगा। यदि आप पेलोड से हाइपरपैरामीटर का उपयोग करना चाहते हैं, तो आप सेट करना चाह सकते हैं hyper_params_dict इसके बजाय पैरामीटर शून्य के रूप में।

#Specify the Batch Job Hyper Params Here, If you want to treate each example hyperparameters different please pass hyper_params_dict as None
hyper_params = {"batch_size":4, "max_length":50, "top_k": 50, "top_p": 0.95, "do_sample": True}
hyper_params_dict = {"HYPER_PARAMS":str(hyper_params)}

बैच परिवर्तन के लिए डेटा तैयार करें

अब हम लोड करने के लिए तैयार हैं सीएनएन_डेलीमेल हगिंग फेस से डेटासेट:

cnn_test = load_dataset('cnn_dailymail','3.0.0',split='test')

हम प्रत्येक डेटा प्रविष्टि पर जाते हैं और आवश्यक प्रारूप में इनपुट डेटा बनाते हैं। हम एक बनाते हैं articles.jsonl एक परीक्षण डेटा फ़ाइल के रूप में फ़ाइल करें जिसमें ऐसे लेख हों जिन्हें इनपुट पेलोड के रूप में संक्षेपित करने की आवश्यकता हो। जैसे ही हम यह फ़ाइल बनाते हैं, हम प्रॉम्प्ट जोड़ते हैं "Briefly summarize this text:" प्रत्येक परीक्षण इनपुट पंक्ति के लिए। यदि आप प्रत्येक परीक्षण इनपुट के लिए अलग-अलग हाइपरपैरामीटर चाहते हैं, तो आप डेटासेट बनाने के हिस्से के रूप में उन हाइपरपैरामीटर को जोड़ सकते हैं।

हम बनाते हैं highlights.jsonl जमीनी सच्चाई वाली फ़ाइल के रूप में जिसमें परीक्षण फ़ाइल में संग्रहीत प्रत्येक लेख की मुख्य बातें शामिल हैं articles.jsonl. हम दोनों परीक्षण फ़ाइलों को एक में संग्रहीत करते हैं अमेज़न सरल भंडारण सेवा (अमेज़ॅन S3) बाल्टी। निम्नलिखित कोड देखें:

#You can specify a prompt here
prompt = "Briefly summarize this text: "
#Provide the test data and the ground truth file name
test_data_file_name = "articles.jsonl"
test_reference_file_name = 'highlights.jsonl' test_articles = []
test_highlights =[] # We will go over each data entry and create the data in the input required format as described above
for id, test_entry in enumerate(cnn_test): article = test_entry['article'] highlights = test_entry['highlights'] # Create a payload like this if you want to have different hyperparameters for each test input # payload = {"id": id,"text_inputs": f"{prompt}{article}", "max_length": 100, "temperature": 0.95} # Note that if you specify hyperparameter for each payload individually, you may want to ensure that hyper_params_dict is set to None instead payload = {"id": id,"text_inputs": f"{prompt}{article}"} test_articles.append(payload) test_highlights.append({"id":id, "highlights": highlights}) with open(test_data_file_name, "w") as outfile: for entry in test_articles: outfile.write("%sn" % json.dumps(entry)) with open(test_reference_file_name, "w") as outfile: for entry in test_highlights: outfile.write("%sn" % json.dumps(entry)) # Uploading the data s3 = boto3.client("s3")
s3.upload_file(test_data_file_name, output_bucket, os.path.join(output_prefix + "/batch_input/articles.jsonl"))

बैच ट्रांसफ़ॉर्म कार्य चलाएँ

जब आप बैच ट्रांसफ़ॉर्म कार्य शुरू करते हैं, तो सेजमेकर चयनित इंस्टेंस प्रकार के आधार पर सीपीयू या जीपीयू इंस्टेंस सहित डेटा को संसाधित करने के लिए आवश्यक कंप्यूट संसाधन लॉन्च करता है। बैच ट्रांसफॉर्म जॉब के दौरान, सेजमेकर स्वचालित रूप से डेटा को संसाधित करने के लिए आवश्यक गणना संसाधनों का प्रावधान और प्रबंधन करता है, जिसमें इंस्टेंस, स्टोरेज और नेटवर्किंग संसाधन शामिल हैं। जब बैच ट्रांसफ़ॉर्म कार्य पूरा हो जाता है, तो सेजमेकर द्वारा गणना संसाधनों को स्वचालित रूप से साफ़ कर दिया जाता है। इसका मतलब यह है कि कार्य के दौरान उपयोग किए गए इंस्टेंसेस और स्टोरेज को रोक दिया जाता है और हटा दिया जाता है, जिससे संसाधन खाली हो जाते हैं और लागत कम हो जाती है। निम्नलिखित कोड देखें:

# Creating the Batch transformer object
batch_transformer = model.transformer( instance_count=1, instance_type=inference_instance_type, output_path=s3_output_data_path, assemble_with="Line", accept="text/csv", max_payload=1, env = hyper_params_dict
) # Making the predications on the input data
batch_transformer.transform(s3_input_data_path, content_type="application/jsonlines", split_type="Line") batch_transformer.wait()

निम्नलिखित में से एक उदाहरण रिकॉर्ड है articles.jsonl परीक्षण फ़ाइल. ध्यान दें कि इस फ़ाइल में रिकॉर्ड में एक आईडी है जो मेल खाती है predict.jsonl फ़ाइल रिकॉर्ड जो हगिंग फेस टेक्स्ट2टेक्स्ट मॉडल से आउटपुट के रूप में एक सारांशित रिकॉर्ड दिखाता है। इसी तरह, जमीनी सच्चाई फ़ाइल में डेटा रिकॉर्ड के लिए एक मिलान आईडी भी होती है। परीक्षण फ़ाइल, जमीनी सच्चाई फ़ाइल और आउटपुट फ़ाइल में मिलान आईडी परिणामों की आसान व्याख्या के लिए इनपुट रिकॉर्ड को आउटपुट रिकॉर्ड के साथ जोड़ने की अनुमति देती है।

संक्षेपण के लिए प्रदान किया गया उदाहरण इनपुट रिकॉर्ड निम्नलिखित है:

{"id": 0, "text_inputs": "Briefly summarize this text: (CNN)The Palestinian Authority officially became the 123rd member of the International Criminal Court on Wednesday, a step that gives the court jurisdiction over alleged crimes in Palestinian territories. The formal accession was marked with a ceremony at The Hague, in the Netherlands, where the court is based. The Palestinians signed the ICC's founding Rome Statute in January, when they also accepted its jurisdiction over alleged crimes committed "in the occupied Palestinian territory, including East Jerusalem, since June 13, 2014." Later that month, the ICC opened a preliminary examination into the situation in Palestinian territories, paving the way for possible war crimes investigations against Israelis. As members of the court, Palestinians may be subject to counter-charges as well. Israel and the United States, neither of which is an ICC member, opposed the Palestinians' efforts to join the body. But Palestinian Foreign Minister Riad al-Malki, speaking at Wednesday's ceremony, said it was a move toward greater justice. "As Palestine formally becomes a State Party to the Rome Statute today, the world is also a step closer to ending a long era of impunity and injustice," he said, according to an ICC news release. "Indeed, today brings us closer to our shared goals of justice and peace." Judge Kuniko Ozaki, a vice president of the ICC, said acceding to the treaty was just the first step for the Palestinians. "As the Rome Statute today enters into force for the State of Palestine, Palestine acquires all the rights as well as responsibilities that come with being a State Party to the Statute. These are substantive commitments, which cannot be taken lightly," she said. Rights group Human Rights Watch welcomed the development. "Governments seeking to penalize Palestine for joining the ICC should immediately end their pressure, and countries that support universal acceptance of the court's treaty should speak out to welcome its membership," said Balkees Jarrah, international justice counsel for the group. "What's objectionable is the attempts to undermine international justice, not Palestine's decision to join a treaty to which over 100 countries around the world are members." In January, when the preliminary ICC examination was opened, Israeli Prime Minister Benjamin Netanyahu described it as an outrage, saying the court was overstepping its boundaries. The United States also said it "strongly" disagreed with the court's decision. "As we have said repeatedly, we do not believe that Palestine is a state and therefore we do not believe that it is eligible to join the ICC," the State Department said in a statement. It urged the warring sides to resolve their differences through direct negotiations. "We will continue to oppose actions against Israel at the ICC as counterproductive to the cause of peace," it said. But the ICC begs to differ with the definition of a state for its purposes and refers to the territories as "Palestine." While a preliminary examination is not a formal investigation, it allows the court to review evidence and determine whether to investigate suspects on both sides. Prosecutor Fatou Bensouda said her office would "conduct its analysis in full independence and impartiality." The war between Israel and Hamas militants in Gaza last summer left more than 2,000 people dead. The inquiry will include alleged war crimes committed since June. The International Criminal Court was set up in 2002 to prosecute genocide, crimes against humanity and war crimes. CNN's Vasco Cotovio, Kareem Khadder and Faith Karimi contributed to this report."}

सारांश के साथ अनुमानित आउटपुट निम्नलिखित है:

{'id': 0, 'generated_texts': ['The Palestinian Authority officially became a member of the International Criminal Court on Wednesday, a step that gives the court jurisdiction over alleged crimes in Palestinian territories.']}

मॉडल मूल्यांकन उद्देश्यों के लिए जमीनी सच्चाई का सारांश निम्नलिखित है:

{"id": 0, "highlights": "Membership gives the ICC jurisdiction over alleged crimes committed in Palestinian territories since last June .nIsrael and the United States opposed the move, which could open the door to war crimes investigations against Israelis ."}

इसके बाद, हम मॉडल मूल्यांकन के लिए जमीनी सच्चाई और अनुमानित आउटपुट का उपयोग करते हैं।

ROUGE स्कोर का उपयोग करके मॉडल का मूल्यांकन करें¶

लाल, या रिकॉल-ओरिएंटेड अंडरस्टूडी फॉर गिस्टिंग इवैल्यूएशन, मेट्रिक्स का एक सेट और एक सॉफ्टवेयर पैकेज है जिसका उपयोग प्राकृतिक भाषा प्रसंस्करण में स्वचालित सारांश और मशीन अनुवाद के मूल्यांकन के लिए किया जाता है। मेट्रिक्स स्वचालित रूप से उत्पादित सारांश या अनुवाद की तुलना संदर्भ (मानव-निर्मित) सारांश या अनुवाद या संदर्भों के एक सेट से करते हैं।

निम्नलिखित कोड में, हम पूर्वानुमानित और मूल सारांशों को सामान्य कुंजी पर जोड़कर जोड़ते हैं id और ROUGE स्कोर की गणना करने के लिए इसका उपयोग करें:

# Downloading the predictions
s3.download_file(
output_bucket, output_prefix + "/batch_output/" + "articles.jsonl.out", "predict.jsonl"
) with open('predict.jsonl', 'r') as json_file:
json_list = list(json_file) # Creating the prediction list for the dataframe
predict_dict_list = []
for predict in json_list:
if len(predict) > 1:
predict_dict = ast.literal_eval(predict)
predict_dict_req = {"id": predict_dict["id"], "prediction": predict_dict["generated_texts"][0]}
predict_dict_list.append(predict_dict_req) # Creating the predictions dataframe
predict_df = pd.DataFrame(predict_dict_list) test_highlights_df = pd.DataFrame(test_highlights) # Combining the predict dataframe with the original summarization on id to compute the rouge score
df_merge = test_highlights_df.merge(predict_df, on="id", how="left") rouge = evaluate.load('rouge')
results = rouge.compute(predictions=list(df_merge["prediction"]),references=list(df_merge["highlights"]))
print(results)
{'rouge1': 0.32749078992945646, 'rouge2': 0.126038645005132, 'rougeL': 0.22764277967933363, 'rougeLsum': 0.28162915746368966}

वास्तविक समय बैच अनुमान निष्पादित करें

इसके बाद, हम आपको दिखाते हैं कि सूची के रूप में इनपुट प्रदान करके एंडपॉइंट पर वास्तविक समय बैच अनुमान कैसे चलाया जाए। हम पहले की तरह ही मॉडल आईडी और डेटासेट का उपयोग करते हैं, सिवाय इसके कि हम परीक्षण डेटासेट से कुछ रिकॉर्ड लेते हैं और वास्तविक समय समापन बिंदु को लागू करने के लिए उनका उपयोग करते हैं।

निम्नलिखित कोड दिखाता है कि रीयल-टाइम बैच अनुमान के लिए रीयल-टाइम एंडपॉइंट कैसे बनाएं और तैनात करें:

from sagemaker.utils import name_from_base
endpoint_name = name_from_base(f"jumpstart-example-{model_id}")
# deploy the Model. Note that we need to pass Predictor class when we deploy model through Model class,
# for being able to run inference through the sagemaker API.
model_predictor = model.deploy( initial_instance_count=1, instance_type=inference_instance_type, predictor_cls=Predictor, endpoint_name=endpoint_name
)

इसके बाद, हम अपना इनपुट पेलोड तैयार करते हैं। इसके लिए, हम उस डेटा का उपयोग करते हैं जो हमने पहले तैयार किया था और पहले 10 परीक्षण इनपुट निकालते हैं और टेक्स्ट इनपुट को हाइपरपैरामीटर के साथ जोड़ते हैं जिन्हें हम उपयोग करना चाहते हैं। हम यह पेलोड वास्तविक समय पर प्रदान करते हैं invoke_endpoint. फिर प्रतिक्रिया पेलोड को प्रतिक्रियाओं की सूची के रूप में वापस कर दिया जाता है। निम्नलिखित कोड देखें:

#Provide all the text inputs to the model as a list
text_inputs = [entry["text_inputs"] for entry in test_articles[0:10]] # The information about the different Parameters is provided above
payload = { "text_inputs": text_inputs, "max_length": 50, "num_return_sequences": 1, "top_k": 50, "top_p": 0.95, "do_sample": True, "batch_size": 4
} def query_endpoint_with_json_payload(encoded_json, endpoint_name):
client = boto3.client("runtime.sagemaker")
response = client.invoke_endpoint(
EndpointName=endpoint_name, ContentType="application/json", Body=encoded_json
)
return response query_response = query_endpoint_with_json_payload(
json.dumps(payload).encode("utf-8"), endpoint_name=endpoint_name
) def parse_response_multiple_texts(query_response):
model_predictions = json.loads(query_response["Body"].read())
return model_predictions generated_text_list = parse_response_multiple_texts(query_response)
print(*generated_text_list, sep='n')

क्लीन अप

समापन बिंदु का परीक्षण करने के बाद, सुनिश्चित करें कि आपने SageMaker निष्कर्ष समापन बिंदु को हटा दिया है और शुल्क लगाने से बचने के लिए मॉडल को हटा दिया है।

निष्कर्ष

इस नोटबुक में, हमने संक्षेपण कार्यों के लिए हगिंग फेस टेक्स्ट2टेक्स्ट जेनरेटर मॉडल को प्रदर्शित करने के लिए एक बैच ट्रांसफ़ॉर्म किया। लगातार समापन बिंदु की आवश्यकता के बिना बड़े डेटासेट से निष्कर्ष प्राप्त करने में बैच परिवर्तन फायदेमंद है। हमने परिणाम की व्याख्या में सहायता के लिए इनपुट रिकॉर्ड को अनुमानों के साथ जोड़ा। हमने मॉडल-जनरेटेड सारांश के साथ परीक्षण डेटा सारांश की तुलना करने के लिए ROUGE स्कोर का उपयोग किया।

इसके अतिरिक्त, हमने वास्तविक समय बैच अनुमान का प्रदर्शन किया, जहां आप स्ट्रीमिंग इनपुट डेटा जैसे परिदृश्यों के लिए विलंबता और थ्रूपुट के बीच संतुलन प्राप्त करने के लिए वास्तविक समय समापन बिंदु पर डेटा का एक छोटा बैच भेज सकते हैं। वास्तविक समय बैच अनुमान वास्तविक समय अनुरोधों के लिए थ्रूपुट बढ़ाने में मदद करता है।

आज ही सेजमेकर में टेक्स्ट2टेक्स्ट जेनरेशन मॉडल के साथ बैच ट्रांसफॉर्म को आज़माएं और हमें अपनी प्रतिक्रिया बताएं!


लेखक के बारे में

Amazon SageMaker जम्पस्टार्ट Text2Text जनरेशन के बड़े भाषा मॉडल के साथ बैच परिवर्तन करें | अमेज़ॅन वेब सेवाएँ प्लेटोब्लॉकचेन डेटा इंटेलिजेंस। लंबवत खोज. ऐ.हेमंत सिंह अमेज़ॅन सेजमेकर जम्पस्टार्ट और अमेज़ॅन सेजमेकर बिल्ट-इन एल्गोरिदम में अनुभव के साथ एक मशीन लर्निंग इंजीनियर है। उन्होंने कूरेंट इंस्टीट्यूट ऑफ मैथमैटिकल साइंसेज से मास्टर डिग्री और आईआईटी दिल्ली से बी.टेक की डिग्री हासिल की। उनके पास प्राकृतिक भाषा प्रसंस्करण, कंप्यूटर दृष्टि और समय श्रृंखला विश्लेषण के क्षेत्र में मशीन सीखने की विभिन्न समस्याओं पर काम करने का अनुभव है।

Amazon SageMaker जम्पस्टार्ट Text2Text जनरेशन के बड़े भाषा मॉडल के साथ बैच परिवर्तन करें | अमेज़ॅन वेब सेवाएँ प्लेटोब्लॉकचेन डेटा इंटेलिजेंस। लंबवत खोज. ऐ.रचना चड्ढा AWS में स्ट्रैटेजिक अकाउंट्स में प्रिंसिपल सॉल्यूशंस आर्किटेक्ट AI/ML हैं। रचना एक आशावादी हैं जो मानती हैं कि एआई के नैतिक और जिम्मेदार उपयोग से भविष्य में समाज में सुधार हो सकता है और आर्थिक और सामाजिक समृद्धि आ सकती है। अपने खाली समय में रचना को अपने परिवार के साथ समय बिताना, घूमना-फिरना और संगीत सुनना पसंद है।

Amazon SageMaker जम्पस्टार्ट Text2Text जनरेशन के बड़े भाषा मॉडल के साथ बैच परिवर्तन करें | अमेज़ॅन वेब सेवाएँ प्लेटोब्लॉकचेन डेटा इंटेलिजेंस। लंबवत खोज. ऐ.डॉ आशीष खेतानी Amazon SageMaker बिल्ट-इन एल्गोरिदम के साथ एक वरिष्ठ एप्लाइड साइंटिस्ट हैं और मशीन लर्निंग एल्गोरिदम विकसित करने में मदद करते हैं। उन्होंने इलिनोइस विश्वविद्यालय उरबाना-शैंपेन से पीएचडी की उपाधि प्राप्त की। वह मशीन लर्निंग और सांख्यिकीय अनुमान में एक सक्रिय शोधकर्ता हैं, और उन्होंने NeurIPS, ICML, ICLR, JMLR, ACL और EMNLP सम्मेलनों में कई पत्र प्रकाशित किए हैं।

समय टिकट:

से अधिक AWS मशीन लर्निंग