docstr: Order mentions to documents topics
  Args:
      mentions: json mentions file
  
  Returns:
      List[Topic] of the mentions separated by their documents topics
docstr_tok: ["Order","mentions","to","documents","topics","Args",":","mentions",":","json","mentions","file","Returns",":","List","[","Topic","]","of","the","mentions","separated","by","their","documents","topics"]
code: def order_mentions_by_topics(self, mentions: str) -> List[Topic]:
      """
      Order mentions to documents topics
      Args:
          mentions: json mentions file
  
      Returns:
          List[Topic] of the mentions separated by their documents topics
      """
      running_index = 0
      topics = []
      current_topic_ref = None
      for mention_line in mentions:
          mention = MentionData.read_json_mention_data_line(
              mention_line
          )
  
          if self.keep_order:
              if mention.mention_index == -1:
                  mention.mention_index = running_index
                  running_index += 1
  
          topic_id = mention.topic_id
  
          if (
              not current_topic_ref
              or len(topics) > 0
              and topic_id != topics[-1].topic_id
          ):
              current_topic_ref = Topic(topic_id)
              topics.append(current_topic_ref)
  
          current_topic_ref.mentions.append(mention)
  
      return topics
  
file_path: nlp-architect/nlp_architect/common/cdc/topics.py
imports: import logging
  import time
  from typing import List
  from nlp_architect.common.cdc.mention_data import MentionData
  from nlp_architect.utils.io import load_json_file
label_desc: Use image node_id 4 for calling the Topics obj's underlying member method code with example usage: obj.order_mentions_by_topics(mentions) and returns: topics