Rule-based learning algorithm for fact extraction