def s_wAB(A, B, cossims):
	"""
	Return vector of s(w, A, B) across w, where
		s(w, A, B) = mean_{a in A} cos(w, a) - mean_{b in B} cos(w, b).
	"""
	return cossims[:, A].mean(axis=1) - cossims[:, B].mean(axis=1)