Network slicing is predetermined to hold up the diversity of emerging applications with enhanced performance and flexibility requirements in the way of splitting the physical network into numerous logical networks. Consequently, a tremendous data count has been generated with an enormous number of mobile phones due to these applications. This has made remarkable challenges and has a considerable influence on the network slicing performance. This work aims to design an efficient network slicing using a hybrid learning algorithm. Thus, we proposed a model, which involves three main phases: (a) Data collection, (b) Optimal weighted feature extraction (OWFE), and (c) Slicing classification. First, we collected the 5G network slicing dataset, which involves the attributes associated with various network devices like “user device type, duration, packet loss ratio, packet delay budget, bandwidth, delay rate, speed, jitter, and modulation type.” Next, we performed the OWFE, in which a weight function is multiplied with the attribute values to have high scale variation. We optimized this weight function by the hybridization of two meta-heuristic algorithms—glowworm swarm optimization and deer hunting optimization algorithm (DHOA)—and named the proposed model glowworm swarm-based DHOA (GS-DHOA). For the given attributes, we classified the exact network slices like “eMBB, mMTC, and URLLC” for each device by a hybrid classifier using deep belief and neural networks. The weight function of both networks is optimized by the GS-DHOA. The experiment results revealed that the proposed model could influence the provision of accurate 5G network slicing.