Summarizer: thuộc tính expectedInputLanguages
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 expectedInputLanguages chỉ đọc của giao diện Summarizer trả về các ngôn ngữ mà Summarizer nên hỗ trợ.
Giá trị
Một mảng các chuỗi chỉ định các ngôn ngữ mà Summarizer nên hỗ trợ.
Các chuỗi phải là thẻ ngôn ngữ BCP 47 hợp lệ.
Ví dụ
js
const summarizer = await Summarizer.create({
expectedInputLanguages: ["en-US", "fr"],
// ...
});
// Ghi log "en-US"
console.log(summarizer.expectedInputLanguages[0]);
Thông số kỹ thuật
| Specification |
|---|
| Writing Assistance APIs> # dom-summarizer-expectedinputlanguages> |
Tương thích trình duyệt
Xem thêm
- Sử dụng Summarizer API
- Web AI demos trên chrome.dev