Due to the disorder and lack of topological information, the classification and segmentation of 3D point clouds is still challenging. To this end, this study designs a 3D point cloud classification algorithm based on the self-attention mechanism to learn point cloud feature information for object classification and segmentation. Firstly, a self-attention module suitable for point clouds is designed for feature extraction. A neighborhood graph is constructed to enhance the input embedding, and the local features are extracted and aggregated by utilizing the self-attention mechanism. Finally, the local features are combined via multi-layer perceptron and encoder-decoder approaches to achieve 3D point cloud classification and segmentation. This method considers the local context information of individual points in the point cloud during input embedding, constructs a network structure under local long distances, and ultimately yields more distinctive results. Experiments on datasets such as ShapeNetPart and RoofN3D demonstrate that the proposed method performs better in classification and segmentation.