code: def rerank(query, results):
      # deduplicate
      results = set(itertools.chain(*results))
  
      # re-rank
      encoder = CrossEncoder("cross-encoder/ms-marco-MiniLM-L-6-v2")
      scores = encoder.predict([(query, item[1]) for item in results])
      return [v for _, v in sorted(zip(scores, results), reverse=True)]
  
imports: import asyncio
  import itertools
  from pgvector.psycopg import register_vector_async
  import psycopg
  from sentence_transformers import CrossEncoder, SentenceTransformer
label_desc: Use image node_id 1 for calling a global function with example usage: rerank(query, results) and returns: unknown