Multipartite entanglement in spin chains and the hyperdeterminant