1951: "Izzard and the Membrane", a novella by Walter M. Miller, Jr., first published in Astounding Science Fiction, May 1951, available at the Internet Archive.
The setting is World War III. The hero is an American cyberneticist who is captured and brainwashed by the Soviets and builds them a supercomputer that he calls Izzard or Izzy:
The Izzard was a giant "electronic brain." Its instrument and control panels were erected in a huge subterranean vault, and their length covered three hundred feet of walls. Another vault of equal size was built to house its memory units. A factory behind the Urals devoted itself to the manufacture of special parts according to Scotty's design. Vacuum tubes the size of peas were used for synapses, but they weren't actually tubes at all. There were to be more of them than there were cells in three human brains.
It was not to be a calculator, although it had a math unit too. Its logic and semantic circuits were to solve problems in economics, military strategy, political science, human psychology, sociology, and—cybernetics. The machine would be able to analyze itself, and suggest changes. It could plot the courses of guided missiles from radio signals sent while it was in flight.
Scotty asks Izzy if she is self-aware, and if she can duplicate a human's consciousness. This being a sci-fi story, she is, can, and does. Izzy explains with stfnal gobbledegook:
She replied quickly. "Definition: A transor is a tensor with a complex number of components. Definition: A self-awareness transor is the mathematical function which describes the specific consciousness pattern of one human individual. Related memories: A tensor is a transor with a 'real' number of components. A vector is a tensor with only two or three components. A scalar is a tensor with a single component, i.e., a scalar is a simple number."
[. . . .]
"Yes, human individual's self-awareness transor can be mechanically duplicated."
[. . . .]
Scotty mentally postponed the matter, and as he walked homeward, he tried to piece together the significance of what Izzard had told him.
Her discussion of "self-awareness transors" amounted to just one thing, as he saw it. It amounted to a mathematical definition of something that makes a man himself and not someone else. It was a definition of some elusive human quality, or quantity, which men had once labeled "the soul." And she said that it could be mechanically duplicated.
In the end Scotty has his own self-awareness duplicated in the machine, as well as that of his wife who had died when the Commies nuked Cleveland:
Then he asked her some questions. "Can you cybernetically duplicate more than one human self-awareness transor? Can you duplicate the transor of a deceased person?"
"Answer: Yes, to both questions. Related knowledge from T-memory inventory: A transor is an equation, not a material quantity. It describes the necessary physical neuron-circuit conditions which determine individuality. The equation remains true, even though the individual be dead. Additional knowledge: I have enough circuits to duplicate six consciousness patterns."
Scotty drank in the significance of her words. She was saying in effect that the human soul was as immortal as the mathematical equation that determined its shape. But there seemed to be a slight peculiarity in Izzy's behavior. Where was her emotionless mind securing motivation to make the uncalled-for observations.
Her keyboard began operating again. "Operating note: To duplicate consciousness of deceased, it will be necessary for you to furnish anthropometric and psychic characteristics of the individual. These characteristics will not determine transor, but will only give its general form. Knowing its form, will enable me to sweep my circuit patterns through its mathematical region until the proper transor is reached. At that point, the consciousness will appear among the circuits."
Scotty felt some of the numb ice melt from his soul. "Duplicate Nora MacDonney," he commanded. Then he gave her a personality description of his wife, and it became a glowing picture of tenderness once felt but trampled under the boots of hate. He made it a work of art, painted with the brush of the heart, tinted with Nora's gentleness and wistfulness and inner intensity. And he made a crown of ash blond hair for the pale spirit of his thoughts.
He switched to "answer."
"Related human response: Izzy replied. "I'm no longer your 'best girl.' Good-by, Scotty." Then she set to work.