|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
Random Story Generation: the context to next words dictionary
-/1
Here is an example of a story list:
['And', 'the', 'fan,', 'and', 'the', 'cup,', 'And', 'the', 'ship,', 'and', 'the', 'fish.']
You have worked out that it makes sense to represent the context information as a dictionary where the keys are tuples of strings and the values are lists of strings.
Below, we have given you the first key; write the list of values for it. Fill in the dictionary with all the 2-word contexts and their values.
Reminder: Python is case sensitive, so 'And' and 'and' are not equal.
context_to_next_words = {('And', 'the'): ['fan'],... |
|