In compositional reservoir simulation, a significant portion of the CPU time is consumed in phase equilibrium calculations. Previous studies have incorporated the machine learning (ML) technique to accelerate and stabilize the phase equilibrium calculations. However, there are two main limitations: 1) previous work mainly focuses on conventional reservoirs, which cannot be extended to unconventional reservoirs; 2) previous studies are limited to fluid compositions with specific hydrocarbon components that narrows their application. In this paper, we propose a novel ML-assisted framework for phase equilibrium calculations in shale reservoirs. A general set of pseudo-components is considered to allow users to customize the composition of hydrocarbon mixtures. A pore size-dependent EOS is applied to simulate the fluid phase behavior in nano-scale conditions. In the stability test, the multilayer perceptron (MLP) is trained to predict the fluid phase state: single-phase or two-phase. For the fluid labeled as two-phase condition, the phase-split computation is performed to obtain the equilibrium ratio. Instead of using the initial estimate from the stability test, the MLP and the physics-informed neural network (PINN) are applied to obtain the initial estimates for the minimization program. The results show that, with the assistance of ML technique, we are able to reduce the computation time needed for the nano-scale phase equilibrium calculations by more than two orders of magnitude while maintaining 97% accuracy. Compared with MLP, PINN can accurately predict the equilibrium ratios with a limited range of input variables but require more training time. The progress of this study present a ML-assisted framework for phase equilibrium calculations and the generalized proxy phase-equilibrium calculator can be compiled into reservoir simulator to accelerate flash calculation.