I can convert two lists to dictionary
>>> keys = ['a', 'b', 'c']
>>> values = [1, 2, 3]
>>> dictionary = dict(zip(keys, values))
>>> print dictionary
How to convert it to dictionary with keys but values as list.
keys = ['a', 'b', 'c' ,'a']
values=[1, 2, 3, 4]
Output:
{'a': [1,4], 'c': [3], 'b': [2]}
I am using this in dependency parser to get corresponding adjectives for nouns in text. Note I have to do this for huge text so efficency matters.
Please state the computational time of approach as well.