function to extract annotations from html