There’re number of potential things that make your code very slow when you’ve big graphs:

Your graph object is very big and you’re storing the nodes and edges in lists!
You are not using the batched computation.
negative_sampling is probing a list which is also slow for huge lists.

line_profiler is pointing you to where the issues are.