Summarizer: thuộc tính sharedContext
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.
Thuộc tính sharedContext chỉ đọc của giao diện Summarizer trả về một chuỗi mô tả ngữ cảnh mà các đoạn văn bản cần tóm tắt đang được sử dụng trong đó. Điều này giúp Summarizer tạo ra các bản tóm tắt phù hợp hơn.
Giá trị
Một chuỗi.
Ví dụ
js
const summarizer = await Summarizer.create({
sharedContext:
"A general summary to help a user decide if the text is worth reading",
// ...
});
// Ghi log "A general summary to help a user ..."
console.log(summarizer.sharedContext);
Thông số kỹ thuật
| Specification |
|---|
| Writing Assistance APIs> # dom-summarizer-sharedcontext> |
Tương thích trình duyệt
Xem thêm
- Sử dụng Summarizer API
- Web AI demos trên chrome.dev