Presenting an approach based on weighted CapsuleNet networks for Arabic and Persian multi-domain sentiment analysis

Document Type : Research Paper


1 Department of Computer Engineering, North Tehran Branch, Islamic Azad University, Tehran, Iran

2 Department of Computer Engineering, Sari Branch, Islamic Azad University, Sari, Iran



Sentiment classification is a fundamental task in natural language processing, assigning one of the three classes, positive, negative, or neutral, to free texts. However, sentiment classification models are highly domain dependent; the classifier may perform classification with reasonable accuracy in one domain but not in another due to the Semantic multiplicity of words getting poor accuracy. This article presents a new Persian/Arabic multi-domain sentiment analysis method using the cumulative weighted capsule networks approach. Weighted capsule ensemble consists of training separate capsule networks for each domain and a weighting measure called domain belonging degree (DBD). This criterion consists of TF and IDF, which calculates the dependency of each document for each domain separately; this value is multiplied by the possible output that each capsule creates. In the end, the sum of these multiplications is the title of the final output, and is used to determine the polarity. And the most dependent domain is considered the final output for each domain. The proposed method was evaluated using the Digikala dataset and obtained acceptable accuracy compared to the existing approaches. It achieved an accuracy of 0.89 on detecting the domain of belonging and 0.99 on detecting the polarity. Also, for the problem of dealing with unbalanced classes, a cost-sensitive function was used. This function was able to achieve 0.0162 improvements in accuracy for sentiment classification. This approach on Amazon Arabic data can achieve 0.9695 accuracies in domain classification


Articles in Press, Corrected Proof
Available Online from 24 May 2023
  • Receive Date: 17 January 2023
  • Revise Date: 08 May 2023
  • Accept Date: 23 May 2023
  • First Publish Date: 24 May 2023