The invention provides a text processing method and device, and the method comprises the steps: obtaining a question text, and recognizing a question entity in the question text; linking a plurality of candidate entities corresponding to the question entity in a preset knowledge base, and identifying a question type of the question text according to the question entity; generating at least one candidate path corresponding to the question text based on the plurality of candidate entities and the question type, and determining a target path according to the at least one candidate path; and converting the target path into a query statement, and querying an answer text corresponding to the question text in the knowledge base according to the query statement.