How should forward-backward algorithm be implemented for a text file with multiple twitter posts?

16 Views Asked by At

Assuming i have a textfile which shows multiple twitter posts made by different users, how do we approach the forward-backward algorithm? Do we apply throughout the entire textfile by treating it as one huge trellis? Or for each of the posts by treating them as individual trellis?

Question: Define a forward_backward function which implements forward-backward algorithm using twitterposts.txt. - An example of the text file looks like this:
@user1
hello
everyone
!

@user2
are
you
sure
!

Would appreciate any sort of explanation. Thank you in advance!