ทำการแปลงเป็นชุดด้วยโมเดลภาษาขนาดใหญ่ของ Amazon SageMaker Jumpstart Text2Text Generation | บริการเว็บอเมซอน

ทำการแปลงเป็นชุดด้วยโมเดลภาษาขนาดใหญ่ของ Amazon SageMaker Jumpstart Text2Text Generation | บริการเว็บอเมซอน

วันนี้เรารู้สึกตื่นเต้นที่จะประกาศว่าตอนนี้คุณสามารถทำการแปลงเป็นชุดได้ด้วย Amazon SageMaker JumpStart โมเดลภาษาขนาดใหญ่ (LLM) สำหรับ Text2Text Generation การแปลงเป็นชุดมีประโยชน์ในสถานการณ์ที่การตอบสนองไม่จำเป็นต้องเป็นแบบเรียลไทม์ ดังนั้นคุณจึงสามารถทำการอนุมานในชุดข้อมูลขนาดใหญ่เป็นกลุ่มได้ สำหรับการแปลงแบบแบตช์ งานแบบแบตช์จะถูกรันโดยรับอินพุตแบบแบตช์เป็นชุดข้อมูลและแบบจำลองที่ได้รับการฝึกอบรมล่วงหน้า และเอาต์พุตที่คาดการณ์สำหรับแต่ละจุดข้อมูลในชุดข้อมูล การแปลงเป็นชุดมีความคุ้มค่าเนื่องจากไม่เหมือนกับจุดสิ้นสุดที่โฮสต์ตามเวลาจริงที่มีฮาร์ดแวร์ถาวร คลัสเตอร์การแปลงเป็นชุดจะถูกยกเลิกเมื่องานเสร็จสมบูรณ์ ดังนั้นฮาร์ดแวร์จะถูกใช้ในช่วงระยะเวลาของงานเป็นชุดเท่านั้น

ในกรณีการใช้งานบางกรณี คำขออนุมานตามเวลาจริงสามารถจัดกลุ่มเป็นชุดย่อยสำหรับการประมวลผลเป็นชุดเพื่อสร้างการตอบสนองแบบเรียลไทม์หรือใกล้เคียงเวลาจริง ตัวอย่างเช่น หากคุณต้องการประมวลผลสตรีมข้อมูลอย่างต่อเนื่องโดยมีเวลาแฝงต่ำและปริมาณงานสูง การเรียกใช้จุดสิ้นสุดตามเวลาจริงสำหรับแต่ละคำขอแยกกันอาจต้องใช้ทรัพยากรมากขึ้นและอาจใช้เวลานานขึ้นในการประมวลผลคำขอทั้งหมด เนื่องจากกำลังดำเนินการประมวลผลแบบอนุกรม . วิธีที่ดีกว่าคือการจัดกลุ่มคำขอบางส่วนและเรียกจุดสิ้นสุดตามเวลาจริงในโหมดการอนุมานแบบกลุ่ม ซึ่งจะประมวลผลคำขอของคุณในการส่งต่อโมเดลหนึ่งครั้งและส่งกลับการตอบสนองจำนวนมากสำหรับคำขอแบบเรียลไทม์หรือเวลาใกล้เคียงเรียลไทม์ . เวลาแฝงของการตอบกลับจะขึ้นอยู่กับจำนวนคำขอที่คุณจัดกลุ่มเข้าด้วยกันและขนาดหน่วยความจำอินสแตนซ์ ดังนั้น คุณจึงสามารถปรับขนาดแบทช์ตามความต้องการทางธุรกิจของคุณสำหรับเวลาแฝงและปริมาณงาน เราเรียกสิ่งนี้ว่า การอนุมานแบบแบทช์ตามเวลาจริง เนื่องจากเป็นการรวมแนวคิดของการแบทช์ในขณะที่ยังคงให้การตอบสนองตามเวลาจริง ด้วยการอนุมานแบบกลุ่มตามเวลาจริง คุณสามารถสร้างความสมดุลระหว่างเวลาแฝงต่ำและปริมาณงานสูง ทำให้คุณสามารถประมวลผลข้อมูลปริมาณมากได้อย่างทันท่วงทีและมีประสิทธิภาพ

Jumpstart การแปลงเป็นชุดสำหรับรุ่น Text2Text Generation ช่วยให้คุณสามารถส่งไฮเปอร์พารามิเตอร์แบบกลุ่มผ่านตัวแปรสภาพแวดล้อมที่เพิ่มปริมาณงานและลดเวลาแฝงให้เหลือน้อยที่สุด

JumpStart มีโมเดลโอเพ่นซอร์สที่ผ่านการฝึกอบรมล่วงหน้าสำหรับประเภทปัญหาที่หลากหลาย เพื่อช่วยให้คุณเริ่มต้นใช้งานแมชชีนเลิร์นนิง (ML) คุณสามารถฝึกและปรับแต่งโมเดลเหล่านี้แบบค่อยเป็นค่อยไปก่อนที่จะปรับใช้ JumpStart ยังมีเทมเพลตโซลูชันที่ตั้งค่าโครงสร้างพื้นฐานสำหรับกรณีการใช้งานทั่วไป และโน้ตบุ๊กตัวอย่างที่สามารถดำเนินการได้สำหรับ ML ด้วย อเมซอน SageMaker. คุณสามารถเข้าถึงโมเดลที่ผ่านการฝึกอบรมล่วงหน้า เทมเพลตโซลูชัน และตัวอย่างผ่านหน้า Landing Page ของ JumpStart ใน สตูดิโอ Amazon SageMaker. คุณยังสามารถเข้าถึงโมเดล JumpStart โดยใช้ SageMaker Python SDK

ในโพสต์นี้ เราจะสาธิตวิธีการใช้อุปกรณ์ที่ได้รับการฝึกฝนมาล่วงหน้าอันทันสมัย รุ่น text2text FLAN T5 จาก Hugging Face สำหรับการแปลงเป็นชุดและการอนุมานเป็นชุดตามเวลาจริง

ภาพรวมโซลูชัน

สมุดบันทึกที่แสดงการแปลงเป็นชุดของรุ่น Text2Text FLAN T5 ที่ผ่านการฝึกอบรมล่วงหน้าจาก กอดหน้า ได้ในดังต่อไปนี้ พื้นที่เก็บข้อมูล GitHub. สมุดบันทึกนี้ใช้ข้อมูลจาก Hugging Face cnn_dailymail ชุดข้อมูลสำหรับงานสรุปข้อความโดยใช้ SageMaker SDK

ต่อไปนี้เป็นขั้นตอนสำคัญสำหรับการนำการแปลงแบบกลุ่มไปใช้และการอนุมานแบบกลุ่มตามเวลาจริง:

  1. ตั้งค่าข้อกำหนดเบื้องต้น
  2. เลือกแบบจำลองที่ฝึกไว้ล่วงหน้า
  3. ดึงสิ่งประดิษฐ์สำหรับแบบจำลอง
  4. ระบุไฮเปอร์พารามิเตอร์ของงานการแปลงเป็นชุด
  5. เตรียมข้อมูลสำหรับการแปลงเป็นชุด
  6. เรียกใช้งานการแปลงแบทช์
  7. ประเมินการสรุปโดยใช้ สีแดง (Recall-Oriented Understudy for Gisting Evaluation) คะแนน
  8. ทำการอนุมานเป็นชุดตามเวลาจริง

ตั้งค่าข้อกำหนดเบื้องต้น

ก่อนที่คุณจะเรียกใช้โน้ตบุ๊ก คุณต้องดำเนินการตามขั้นตอนการตั้งค่าเริ่มต้นบางขั้นตอน มาตั้งค่าบทบาทการดำเนินการของ SageMaker เพื่อให้มีสิทธิ์เรียกใช้บริการ AWS ในนามของคุณ:

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

เลือกแบบจำลองที่ฝึกไว้ล่วงหน้า

เราใช้โมเดล Hugface-text2text-Flan-t5-Large เป็นโมเดลเริ่มต้น คุณสามารถเรียกดูรายการโมเดล Text2Text ที่มีอยู่บน JumpStart และเลือกโมเดลที่คุณต้องการได้ วิธีนี้เป็นวิธีที่ตรงไปตรงมาในการเลือก ID รุ่นต่างๆ โดยใช้โน้ตบุ๊กเครื่องเดียวกัน เพื่อจุดประสงค์ในการสาธิต เราใช้โมเดล Hugface-text2text-flan-t5-large:

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 พารามิเตอร์เป็น null แทน

#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_dailymail ชุดข้อมูลจาก Hugging Face:

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

เราดำเนินการแต่ละรายการข้อมูลและสร้างข้อมูลอินพุตในรูปแบบที่ต้องการ เราสร้าง articles.jsonl ไฟล์เป็นไฟล์ข้อมูลทดสอบที่มีบทความที่ต้องสรุปเป็นข้อมูลป้อนเข้า ขณะที่เราสร้างไฟล์นี้ เราผนวกพรอมต์ "Briefly summarize this text:" ไปยังแต่ละแถวอินพุตทดสอบ หากคุณต้องการให้มีไฮเปอร์พารามิเตอร์ที่แตกต่างกันสำหรับอินพุตทดสอบแต่ละรายการ คุณสามารถผนวกไฮเปอร์พารามิเตอร์เหล่านั้นเป็นส่วนหนึ่งของการสร้างชุดข้อมูลได้

เราสร้าง highlights.jsonl เป็นไฟล์ความจริงพื้นฐานที่มีไฮไลท์ของแต่ละบทความที่จัดเก็บไว้ในไฟล์ทดสอบ articles.jsonl. เราเก็บไฟล์ทดสอบทั้งสองไว้ในไฟล์ บริการจัดเก็บข้อมูลอย่างง่ายของ Amazon ที่ฝากข้อมูล (Amazon 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"))

รันงานการแปลงแบทช์

เมื่อคุณเริ่มงานการแปลงเป็นชุด SageMaker จะเรียกใช้ทรัพยากรการประมวลผลที่จำเป็นเพื่อประมวลผลข้อมูล รวมถึงอินสแตนซ์ CPU หรือ GPU ขึ้นอยู่กับประเภทอินสแตนซ์ที่เลือก ในระหว่างงานการแปลงเป็นชุด SageMaker จะจัดเตรียมและจัดการทรัพยากรการประมวลผลที่จำเป็นโดยอัตโนมัติในการประมวลผลข้อมูล รวมถึงอินสแตนซ์ พื้นที่จัดเก็บ และทรัพยากรเครือข่าย เมื่องานการแปลงเป็นชุดเสร็จสิ้น SageMaker จะล้างทรัพยากรการประมวลผลโดยอัตโนมัติ ซึ่งหมายความว่าอินสแตนซ์และพื้นที่เก็บข้อมูลที่ใช้ระหว่างงานจะถูกหยุดและลบออก ทำให้ทรัพยากรว่างและลดต้นทุน ดูรหัสต่อไปนี้:

# 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 ไฟล์ทดสอบ โปรดทราบว่าบันทึกในไฟล์นี้มี ID ที่ตรงกับ predict.jsonl บันทึกไฟล์ที่แสดงบันทึกสรุปเป็นเอาต์พุตจากโมเดล Hugging Face Text2Text ในทำนองเดียวกัน ไฟล์ความจริงพื้นยังมี ID ที่ตรงกันสำหรับบันทึกข้อมูล ID ที่ตรงกันในไฟล์ทดสอบ ไฟล์ความจริงพื้นฐาน และไฟล์เอาต์พุตช่วยให้สามารถเชื่อมโยงบันทึกอินพุตกับบันทึกเอาต์พุตเพื่อให้ตีความผลลัพธ์ได้ง่าย

ต่อไปนี้เป็นตัวอย่างบันทึกการป้อนข้อมูลสำหรับการสรุป:

{"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¶

สีแดงหรือ Recall-Oriented Understudy for Gisting Evaluation คือชุดเมตริกและชุดซอฟต์แวร์ที่ใช้สำหรับประเมินการสรุปอัตโนมัติและการแปลด้วยคอมพิวเตอร์ในการประมวลผลภาษาธรรมชาติ เมตริกจะเปรียบเทียบบทสรุปหรือการแปลที่สร้างขึ้นโดยอัตโนมัติกับข้อมูลสรุปหรือการแปลอ้างอิง (ผลิตโดยมนุษย์) หรือชุดข้อมูลอ้างอิง

ในโค้ดต่อไปนี้ เรารวมการสรุปที่คาดคะเนและต้นฉบับเข้าด้วยกันโดยรวมไว้ในคีย์ทั่วไป 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 และลบแบบจำลองเพื่อหลีกเลี่ยงค่าใช้จ่ายที่เกิดขึ้น

สรุป

ในสมุดบันทึกนี้ เราดำเนินการแปลงเป็นชุดเพื่อแสดงโมเดล Hugging Face Text2Text Generator สำหรับงานสรุป การแปลงเป็นชุดมีประโยชน์ในการรับการอนุมานจากชุดข้อมูลขนาดใหญ่โดยไม่ต้องใช้จุดสิ้นสุดถาวร เราเชื่อมโยงบันทึกอินพุตกับการอนุมานเพื่อช่วยในการตีความผลลัพธ์ เราใช้คะแนน ROUGE เพื่อเปรียบเทียบการสรุปข้อมูลทดสอบกับการสรุปที่สร้างขึ้นโดยโมเดล

นอกจากนี้ เรายังสาธิตการอนุมานเป็นชุดตามเวลาจริง ซึ่งคุณสามารถส่งข้อมูลชุดเล็ก ๆ ไปยังจุดสิ้นสุดตามเวลาจริง เพื่อให้เกิดความสมดุลระหว่างเวลาแฝงและปริมาณงานสำหรับสถานการณ์ต่าง ๆ เช่น การสตรีมข้อมูลอินพุต การอนุมานแบบแบทช์แบบเรียลไทม์ช่วยเพิ่มปริมาณงานสำหรับคำขอแบบเรียลไทม์

ลองใช้การแปลงเป็นชุดด้วยโมเดล Text2Text Generation ใน SageMaker วันนี้และแจ้งให้เราทราบความคิดเห็นของคุณ!


เกี่ยวกับผู้แต่ง

ทำการแปลงเป็นชุดด้วย Amazon SageMaker Jumpstart Text2Text Generation โมเดลภาษาขนาดใหญ่ | Amazon Web Services PlatoBlockchain ข้อมูลอัจฉริยะ ค้นหาแนวตั้ง AI.เหมันต์ ซิงห์ เป็นวิศวกรการเรียนรู้ของเครื่องที่มีประสบการณ์ใน Amazon SageMaker JumpStart และอัลกอริทึมในตัวของ Amazon SageMaker เขาได้รับปริญญาโทจาก Courant Institute of Mathematical Sciences และ B.Tech จาก IIT Delhi เขามีประสบการณ์ในการทำงานเกี่ยวกับปัญหาแมชชีนเลิร์นนิงที่หลากหลายภายในขอบเขตของการประมวลผลภาษาธรรมชาติ คอมพิวเตอร์วิทัศน์ และการวิเคราะห์อนุกรมเวลา

ทำการแปลงเป็นชุดด้วย Amazon SageMaker Jumpstart Text2Text Generation โมเดลภาษาขนาดใหญ่ | Amazon Web Services PlatoBlockchain ข้อมูลอัจฉริยะ ค้นหาแนวตั้ง AI.รจนาชาดา เป็น Principal Solutions Architect AI/ML ในบัญชีเชิงกลยุทธ์ที่ AWS Rachna เป็นคนมองโลกในแง่ดีที่เชื่อว่าการใช้ AI อย่างมีจริยธรรมและมีความรับผิดชอบสามารถปรับปรุงสังคมในอนาคตและนำความเจริญทางเศรษฐกิจและสังคมมาให้ ในเวลาว่าง รัชนาชอบใช้เวลาอยู่กับครอบครัว เดินป่า และฟังเพลง

ทำการแปลงเป็นชุดด้วย Amazon SageMaker Jumpstart Text2Text Generation โมเดลภาษาขนาดใหญ่ | Amazon Web Services PlatoBlockchain ข้อมูลอัจฉริยะ ค้นหาแนวตั้ง AI.ดร. Ashish Khetan เป็นนักวิทยาศาสตร์ประยุกต์อาวุโสที่มีอัลกอริทึมในตัวของ Amazon SageMaker และช่วยพัฒนาอัลกอริทึมการเรียนรู้ของเครื่อง เขาได้รับปริญญาเอกจาก University of Illinois Urbana-Champaign เขาเป็นนักวิจัยที่กระตือรือร้นในด้านแมชชีนเลิร์นนิงและการอนุมานทางสถิติ และได้ตีพิมพ์บทความจำนวนมากในการประชุม NeurIPS, ICML, ICLR, JMLR, ACL และ EMNLP

ประทับเวลา:

เพิ่มเติมจาก AWS Machine Learning AWS