The contested origins of The Beatles’ hits penned under the writing partnership of Paul McCartney and John Lennon could be put to bed by artificial intelligence (AI) software which can identify each artist’s musical influence.

US researchers from Harvard University trained a machine learning algorithm on hundreds of the Fab Four’s hits to build a “musical fingerprint” for each songwriter.

It was then asked to assess eight iconic songs, or musical fragments, recorded between 1962 and 1966, where debate rages over who was the major influence.

This includes tracks like “A Hard Day’s Night” and “In My Life” which are credited to the “Lennon-McCartney partnership”, but are widely believed to be entirely written by one or the other of the pair.

The findings, published in Harvard Data Science Review, allow for each artist’s influences on the song to be assessed, and predicts the probability that either McCartney or Lennon were chiefly responsible.

Unseen photos of The Beatles go on show Show all 12 1 /12 Unseen photos of The Beatles go on show Unseen photos of The Beatles go on show L-R The Beatles, Pete Best , George Harrison, John Lennon, Paul McCartney and 'fifth Beatle' Stuart Sutcliffe (c) Astrid Kirchherr / K&K Unseen photos of The Beatles go on show Queue outside the cavern in Liverpool (c) Astrid Kirchherr / K&K Unseen photos of The Beatles go on show Self Portrait of Astrid Kirchherr (c) Astrid Kirchherr Unseen photos of The Beatles go on show John Lennon at Hamburg fun fair (c) Astrid Kirchherr Unseen photos of The Beatles go on show Paul McCartney on 'Heiligengeistfeld' at Hamburg fun fair (c) Astrid Kirchherr / K&K Unseen photos of The Beatles go on show Portrait of Stuart Sutcliffe (c) Astrid Kirchherr / K&K Unseen photos of The Beatles go on show Impressions of Liverpool's streets and playing kids in 1964 (c) Astrid Kirchherr / K&K Unseen photos of The Beatles go on show Kids playing on Liverpool streets (c) Astrid Kirchherr / K&K Unseen photos of The Beatles go on show Impressions of Liverpool's streets and playing kids in 1964 (c) Astrid Kirchherr / K&K Unseen photos of The Beatles go on show Ringo Starr on a studio shot by Astrid Kirchherr in Hamburg 1962 (c) Astrid Kirchherr / K&K Unseen photos of The Beatles go on show Stuart in the yard (c) Astrid Kirchherr / K&K Unseen photos of The Beatles go on show Portrait of Rory Storm (c) Astrid Kirchherr / K&K

As recently as 2015, Sir Paul McCartney has vented his frustrations at what he sees as “revisionism” over his influence relative to Lennon’s after he was murdered in 1980.

He went as far as reversing the song credits to read “McCartney-Lennon” in a 2002 album – to the annoyance of Lennon’s widow, artist Yoko Ono.

Most of the eight songs of contested authorship were predicted to be predominantly in Lennon’s style, including tracks like “Ask Me Why” and the bridge to “A Hard Day’s Night” which McCartney sang and has suggested in previous interviews he had a role in.

“In My Life”, which Rolling Stone magazine ranked, in 2011, the 23rd greatest song of all time has “garnered the greatest amount of speculation about its true author”, the researchers said.

Lennon wrote the song’s lyrics, but McCartney has claimed he wrote all the music – something Lennon’s account disputed.

The algorithm determined with 81.1 per cent certainty that Lennon wrote the verse, but McCartney’s influence in the song’s bridge was given with 43.5 per cent certainty.

This would corroborate Lennon’s account that Paul contributed to the song’s middle-eight melody.

“Breaking apart the song into the verse and the bridge separately, it is apparent that the verse is much more consistent stylistically with Lennon’s song writing,” the authors wrote.

Other songs like “Baby’s in Black”, “The Word”, and “From Me to You” were more confidently McCartney’s with up to 97 per cent certainty.

The system allows for a study of the way each musicians’ influences change over time, as well as the collaborative nature of song writing in popular music.