sgnlp.models.sentic_gcn.utils.load_and_process_senticnet

load_and_process_senticnet(senticnet_file_path: Optional[str] = None, save_preprocessed_senticnet: bool = False, saved_preprocessed_senticnet_file_path: str = 'senticnet.pkl')Dict[str, float][source]

Helper method to load and process senticnet. Default is SenticNet 5.0. If a saved preprocess senticnet file is available, and save flag is set to false, it will be loaded from file instead. Source: https://github.com/BinLiang-NLP/Sentic-GCN/tree/main/senticnet-5.0

Parameters
  • senticnet_file_path (str) – File path to senticnet 5.0 file.

  • save_preprocessed_senticnet (bool) – Flag to indicate if processed senticnet should be saved.

  • saved_preprocessed_senticnet_file_path – (str): File path to saved preprocessed senticnet file.

Returns

return dictionary with concept word as keys and intensity as values.

Return type

Dict[str, float]