Hello,
In this particular case you have categories "year" and "genre"? Im not an expert on this, but I believe you can implement a ML model in order to classify lyrics into genres. You would need to have a labelled dataset in order to train your model, and then test the model with your own data.
If you have a small set of lyrics you probably prefer to implement a rule based model.
Another approach is to manually label your corpus.
You may use a jsonl file to store your corpus as: {"genre": "I need somebody\n(Help) not just anybody\n(Help)\n you know I need someone, help...(beatles song)", "year": 1965}.
Yet, another approach may be, if your lyrics are stored on some internet database, you may use web scraping (beautiful soup) in order to extract the genre and the year. If there are no years available you can use a Wikipedia dump to extract these.
I hope you may find this useful.