Through your race, or possibly background
The easiest way to get the proficiency would be through a race that gives you proficiences, or through a background which might, with DM permission, grant you proficiency.
Play an elf
Most Elves have proficiency with at least two swords thanks to their Weapon Training.
Play a human variant
You can take the Weapon Master Feat as a variant human to get access to any four weapons.
Play a half-elf variant
In the Sword Coast Adventurer's Guides, there are variant rules for half-elves. You can swap your skill versatility for Elf Weapon Training if you are of wood or high elf descent.
Play a Hobgoblin
Hobgoblins get Martial Training, which gives them proficiency in two martial weapons of your choice.
Play a Githyanki
Their Martial Prodigy gives them proficiency with shortswords, longswords and greatswords.
Possibly RAI: Play a gladiator
The gladiator background (entertainer) has the option of getting 'one unusual weapon'. Convince your DM that your specific sword, such as a scimitar, is unusual and that the background should reasonably give you proficiency. See this question for more on that background.
Not RAW: Favoured Weapons
Previous editions of D&D had a concept of 'favoured weapons' for clerics, which no longer exists in 5e. You might be able to convince your DM to give you a proficiency in your god's favoured weapon, which, while not supported anywhere in the rules, shouldn't really break anything either. Some commonly worshipped gods with swords as their favoured weapons are:
- Helm (Bastard Sword *)
- Kelemvor (Bastard Sword *)
- Torm (Greatsword)
- Tyr (Longsword)
Bastard swords are not existent in 5e because they are considered a type of longsword.