added a function that creates the network starting from the sentences