qnli question: When had samurai last been used in battle? sentence: With no warfare since the early 17th century, samurai gradually lost their military function during the Tokugawa era (also called the Edo period).