# Phân tích văn bản

Phương pháp này phân tích dữ liệu đầu vào và phát hiện nội dung có vấn đề, đoạn văn bản thể hiện cảm xúc, thực thể, chủ đề, cấu trúc cụm từ, các loại từ, từ dừng, v.v.

Endpoint: POST /parse
Version: 4.8.0.0
Security: Tisane-API-Key

## Header parameters:

  - `Content-Type` (string)

## Request fields (application/json):

  - `language` (string, required)

  - `content` (string, required)

  - `settings` (object)

## Response 200 fields (application/json):

  - `text` (string, required)
    Văn bản đầu vào.

  - `language` (string)
    Mã ngôn ngữ, khi sử dụng mã nhận dạng ngôn ngữ.

  - `memory` (object)

  - `memory.flags` (array)

  - `memory.flags.type` (string)
    Loại tính năng. Nếu không xác định: Ngữ pháp
    Enum: "Grammar", "Semantics", "Style"

  - `memory.flags.index` (integer, required)
    Chỉ số tính năng (trong loại tính năng)

  - `memory.flags.value` (string, required)
    ID giá trị tính năng

  - `memory.antecedents` (array)
    Các phần tử được đề cập trước đó sẽ được sử dụng để giải quyết tham chiếu chung.

  - `memory.antecedents.family` (integer)
    ID họ của tiền đề.

  - `memory.assign` (array)
    Các phép gán có điều kiện sẽ được thực hiện khi phân tích cú pháp.

  - `memory.assign.if` (object, required)
    Các điều kiện để khớp (tất cả các điều kiện phải khớp).

  - `memory.assign.if.family` (integer)
    ID họ của trị từ vựng đích.

  - `memory.assign.if.hypernym` (integer)
    ID họ của một thượng vị của trị từ vựng đích.

  - `memory.assign.if.regex` (string)
    Một biểu thức chính quy cần khớp.

  - `memory.assign.then` (object, required)
    Giá trị thuộc tính cần gán.

  - `memory.assign.then.family` (integer)
    Một ID họ cần gán.

  - `memory.assign.then.hypernym` (integer)
    Một ID họ của một thượng vị cần gán.

  - `memory.assign.then.attribution` (boolean)
    Đánh dấu mục tiêu là thuộc tính.

  - `topics` (array)

  - `topics.topic` (string, required)

  - `topics.coverage` (number, required)

  - `abuse` (array)

  - `abuse.offset` (integer, required)
    Vị trí tính từ 0 trong câu

  - `abuse.length` (integer, required)
    Độ dài của đoạn văn bản

  - `abuse.sentence_index` (integer, required)
    Chỉ số của câu nơi có đoạn văn bản

  - `abuse.type` (string, required)
    Loại nội dung có vấn đề
    Enum: "personal_attack", "bigotry", "external_contact", "profanity", "sexual_advances", "criminal_activity", "adult_only", "mental_issues", "contentious", "spam", "social_hierarchy", "no_meaningful_content", "generic"

  - `abuse.severity` (string, required)
    Độ nghiêm trọng của vấn đề
    Enum: "low", "medium", "high", "extreme"

  - `abuse.tags` (array)

  - `abuse.text` (string)
    Bản thân đoạn văn bản (`snippets` phải được đặt thành `true`)

  - `abuse.explanation` (string)
    Cách giải thích con người có thể hiểu được về lý do đánh dấu

  - `sentence_list` (array)

  - `sentence_list.offset` (integer, required)
    Vị trí bắt đầu của câu.

  - `sentence_list.text` (string, required)
    Bản thân câu.

  - `sentence_list.words` (array, required)
    Mảng được mã hóa của các đơn vị từ vựng/khối từ vựng (không nhất thiết phải có khoảng trắng hoặc dấu câu). Phải đặt `words` thành `true` để xuất hiện.

  - `sentence_list.words.offset` (integer, required)
    Vị trí bắt đầu của khối từ vựng.

  - `sentence_list.words.length` (integer, required)
    Độ dài của khối từ vựng.

  - `sentence_list.words.type` (string, required)
    Loại khối từ vựng.
    Enum: "word", "numeral", "punctuation"

  - `sentence_list.words.text` (string, required)
    Chuỗi khối từ vựng.

  - `sentence_list.words.stopword` (boolean)
    Đó có phải là từ dừng hay không.

  - `sentence_list.words.role` (string)
    Vai trò ngữ nghĩa của từ, nếu được gán.
    Enum: "agent", "patient", "complement", "circumstance", "beneficiary", "verb", "surname", "list_item", "given_name", "social_role", "title", "street_name", "street_type", "nickname", "country", "settlement", "state", "zipcode"

  - `sentence_list.words.description` (string)
    Mô tả ý nghĩa không rõ ràng trong bối cảnh hiện tại (luôn bằng tiếng Anh).

  - `sentence_list.words.definition` (string)
    Định nghĩa theo từ điển của nghĩa không rõ ràng trong bối cảnh hiện tại (luôn bằng tiếng Anh).

  - `sentence_list.words.wikidata` (string)
    ID Wikidata của nghĩa từ hiện tại, nếu có.

  - `sentence_list.words.lexeme` (integer)
    Một mã định danh trị từ vựng duy nhất.

  - `sentence_list.words.family` (integer)
    Một mã định danh họ.

  - `sentence_list.parse_tree` (object, required)
    Biểu đồ được sắp xếp theo thứ bậc của các cụm từ được phát hiện trong câu. Phải đặt `parses` thành `true` để xuất hiện.

  - `sentence_list.parse_tree.id` (integer, required)
    Mã định danh thời gian chạy nội bộ của quá trình diễn giải cú pháp câu.

  - `sentence_list.parse_tree.phrases` (array, required)
    Biểu đồ cụm từ, với cụm từ gốc ở cấp cao nhất.

  - `sentence_list.parse_tree.phrases.type` (string, required)
    Loại cụm từ (NP/VP/ADJP/ADVP/S).

  - `sentence_list.parse_tree.phrases.family` (integer, required)
    ID họ của cụm từ.

  - `sentence_list.parse_tree.phrases.offset` (integer, required)
    Vị trí bắt đầu của cụm từ.

  - `sentence_list.parse_tree.phrases.length` (integer, required)
    Độ dài của chuỗi cụm từ.

  - `sentence_list.parse_tree.phrases.text` (string, required)
    Văn bản của cụm từ trong đó các thành viên được phân cách bằng dấu gạch đứng và các cụm từ bên trong nằm trong dấu ngoặc. Ví dụ: *I|(love|Lucy)*.

  - `sentence_list.parse_tree.phrases.role` (string)
    Vai trò ngữ nghĩa của cụm từ trong câu.

  - `sentence_list.parse_tree.phrases.children` (array)

  - `sentence_list.corrected_text` (string)
    Văn bản câu nếu được sửa bằng trình kiểm tra chính tả tích hợp.

  - `entities_summary` (array)

  - `entities_summary.type` (any, required)
    Loại hoặc các loại thực thể.

  - `entities_summary.name` (string, required)
    Tên chuẩn của thực thể.

  - `entities_summary.subtypes` (array)
    Các loại con của thực thể.

  - `entities_summary.subtype` (string)
    Loại con chính của thực thể.

  - `entities_summary.wikidata` (string)
    ID Wikidata, nếu có.

  - `entities_summary.relations` (array)
    Mối quan hệ của thực thể với các thực thể được phát hiện khác.

  - `entities_summary.relations.to` (string, required)
    Thực thể được kết nối với.

  - `entities_summary.relations.links` (array)
    Các thực thể được kết nối như thế nào.

  - `entities_summary.mentions` (array, required)
    Các trường hợp đề cập đến thực thể được tìm thấy trong văn bản đầu vào.

  - `entities_summary.mentions.offset` (integer, required)
    Vị trí tính từ 0 trong câu

  - `entities_summary.mentions.length` (integer, required)
    Độ dài của đoạn văn bản

  - `entities_summary.mentions.sentence_index` (integer, required)
    Chỉ số của câu nơi có đoạn văn bản

  - `entities_summary.mentions.text` (string)
    Bản thân đoạn văn bản (`snippets` phải được đặt thành `true`)

  - `sentiment_expressions` (array)

  - `sentiment_expressions.polarity` (string, required)
    Phân cực cảm xúc
    Enum: "positive", "negative", "mixed", "neutral"

  - `sentiment_expressions.offset` (integer, required)
    Vị trí tính từ 0 trong câu

  - `sentiment_expressions.length` (integer, required)
    Độ dài của đoạn văn bản

  - `sentiment_expressions.sentence_index` (integer, required)
    Chỉ số của câu nơi có đoạn văn bản

  - `sentiment_expressions.targets` (array)
    Mục tiêu của các khía cạnh (để phân tích cảm xúc dựa trên khía cạnh).

  - `sentiment_expressions.reasons` (array)
    Thẻ lý do (để phân tích cảm xúc dựa trên khía cạnh).

  - `sentiment_expressions.text` (string)
    Bản thân đoạn văn bản (`snippets` phải được đặt thành `true`)

  - `sentiment_expressions.explanation` (string)
    Cách giải thích con người có thể hiểu được về lý do đánh dấu

