Learning Task Specifications from Demonstrations as Probabilistic Automata