With the development of the social Internet of Things (IoT) and multimedia communications, our daily lives in computational social systems have become more convenient; for example, we can share shopping experiences and ask questions of people in an ad hoc network. Relation extraction focuses on supervised learning with adequate training data, and it helps to understand the knowledge behind the observed information. However, if only some social data in an unknown area can be used, how to obtain the related knowledge and information is a key topic for supporting social intelligence. This article proposes the joint method of triple attention and novel loss function for entity relation extraction by few-shot learning in computational social systems. We consider using a prototypical network as the base model to acquire support set prototypes and to compare queries with the prototypes for classification. First, triple attention is employed to make the query instances and support set share interactive information in a global and instancewise manner, highlighting the important features. Second, we combine a weighted Euclidean distance function with a multilayer perceptron (MLP) to perform class matching, which maps the generated features to their proper classifications, emphasizing the prominent dimensions in the feature space and relieving data sparsity. Third, triplet loss and uniformity regularization are used to solve the inconsistency problem faced by the support set, where the features of the support set in the same class are often far apart in different characteristic dimensions. Finally, the experimental results demonstrate the improved performance of our model on the FewRel dataset.