Adding on to this since I think previous answers assume you have your data structured differently and don't directly address your issue.
Assuming I'm understanding your data structure correctly and the names of the indices in your matrix don't really matter:
from sklearn.feature_extraction import DictVectorizer
dict = {'device1':['news1', 'news2'],
'device2':['news2', 'news4'],
'device3':['news1', 'news4']}
restructured = []
for key in dict:
data_dict = {}
for news in dict[key]:
data_dict[news] = 1
data_dict['news3'] = 0
restructured.append(data_dict)
#restructured should now look like
'''
[{'news1':1, 'news2':1, 'news3':0},
{'news2':1, 'news4':1, 'news3':0},
{'news1':1, 'news4':1, 'news3':0}]
'''
dictvectorizer = DictVectorizer(sparse=False)
features = dictvectorizer.fit_transform(restructured)
print(features)
#output
'''
[[1, 1, 0, 0],
[0, 1, 1, 0],
[1, 0, 1, 0]]
'''
print(dictvectorizer.get_feature_names())
#output
'''
['news1', 'news2', 'news4', 'news3']
'''