Task: Text Categorization
Input (English): Following his resignation due to a failed harvest, the pipiolos and Diego Portales jockeyed for power. Jose Miguel Carrera shifted allegiances to and from this man, and led the aristocratic opposition to his rule. The illegitimate son of the viceroy of Peru, he led the army that was defeated at Rancagua. Later, he was one of two men who led the victory at Chacabuco, along with Jose de San Martin. For 10 points, name this South American revolutionary, who from 1817 to 1823 was the ruler of Chile.
Output (English): History