I am trying to perform text analysis on large character strings that include multiple different speakers. I need to create a dataframe of 2 columns, speaker and turn, which have the person speaking and the text spoken. I have very long character strings like the below. I chopped up a longer string down by around 50,000 characters, but tried to preserve the diversity of the text:
wha_1949_long <-
"VERBATIM RECORDS OF THE PLENARY MEETINGS FIRST PLENARY MEETING Monday, 13 June 1949, at 11 a.m. Acting President: Dr. Andrija STAMPAR (Yugoslavia) 1. Opening of Session by the President of the First World Health Assembly The ACTING PRESIDENT : It iS my privilege, as President of the first session of the World Health Assembly, to open its second session. My first thoughts are of gratitude to the Italian Government for having offered to our Assembly the hospitality of this ancient city, which has been not only of great importance in the history of mankind but whose medical traditions also stand very high in their antiquity and significance. They have indeed never been interrupted since Galen. But this beautiful country was not only, together with Greece, the cradle of classical medicine.The PRESIDENT : I now open the debate and take pleasure in calling upon the representative of Pakistan. The next country to speak will be Austria. Mr. KAZI (Pakistan) : The delegation of Pakistan is glad to have this opportunity of associating itself wholeheartedly with the sentiments expressed by the previous speakers regarding the part played by Dr. Stampar in this Organization. We will miss his towering personality, 13 Rule 6, as amended, Off. Rec. World Hlth Org. 17, 53 - 91 SIXTH PLENARY MEETING which on many occasions has been of immense help to the Organization in the initial stages of its existence. Our sense of loss is, however, compensated by the feeling that these responsibilities now devolve on you, Mr. President. We realize that this procedure may entail a certain amount of delay which may tax our patience, particularly when we see such misery around us: But in spite of this we would commend this policy, for in the affairs of mankind in general, and of health in particular, it does not always happen that the seemingly shortest is the nearest route to our goal. We observed that the First World Health Assembly passed on most of the puzzling problems to the Executive Board. We now see how right we were, for under the skilful and superb guidance of Sir Aly Shousha, Pasha, the Board has now thrashed out all these problems, and narrowed them down to concrete alternatives. It is our humble submission that in this Assembly too we should beware of rushing into irrevocable decisions and of disregarding the needs for further studies by the Board and by the regional organizations. We feel that this procedure will ensure a solid ground for planning our fresh activities. In certain directions we have, however, to go all out, for there is no turning back on the items of programme to which we have already committed ourselves. But here also let actual experience guide us in the formulation of expansion schemes. For our task often denotes a state of war with the forces of nature, and it is a prerequisite of good generalship to consolidate one's gains before going forwqrd. Analysing our needs, we come up repeatedly against the one fundamental requirement of the underdeveloped and war-damaged areas, namely, the need for technicians, without whom no programme can possibly succeed. The solution offered to this problem is to extend help to the different countries in the shape of instructors and equipment. Accordingly, we welcome the emphasis which the DirectorGeneral has rightly laid on this aspect of the programme. But the training of technicians is a slow, painstaking process, for the knowledge acquired by them has to be assimilated and matured before it can produce the desired result. This process could be greatly hastened by setting up comprehensive teaching facilities in each region for each subject. We feel, however, that there would still be a place for fellowships in foreign countries in our programme, as -the collateral benefits of such interchange of scholars are far too many to be set aside on the plea of utilitarianism. In venturing these few words of advice, Pakistan speaks from experience. We are a newly born State which was faced with a multitude of problems at birth. We saw ahead of us a bewildering variety of vistas, each tempting us for a headlong rush. In the short period of less than two years we have learnt that our greatest progress has been along the paths that had been carefully studied and surveyed. Dr. KHAUM (Austria) (translation from the French): As chief delegate of Austria to the Second World Health Assembly, I have the great honour and pleasure of conveying to you the greetings of the Austrian Government and of expressing our best wishes for the success of the Assembly's work. - 92 SIXTH PLENARY MEETING I also wish to express our greetings to the Italian Government,. which has given us such a friendly welcome, and to our Italian colleagues, as well as to Professor Andrija Stampar, who presided over the Interim Commission and over the Health Assembly last year, and to the new President, Dr. Karl Evang. Austria is a small country and must be reckoned among the European States that have been most heavily stricken by the frightful catastrophe of the Second World War. It is not, however, on that account only that Austria takes an active interest in the World Health Organization, which she thanks for advice and help bestowed in past years, but also because it is her intention and resolve to promote the aims of the World Health Organization with all her strength, and to contribute to the achievement of these aims. In the course of the past few years Austria has made a great advance in public health, and has thus helped to improve health conditions in Central Europe. This improvement is also reflected in the number of cases of infectious disease that have been reported. War epidemics, in the narrower sense of the term, are still declining. In 1948, Austria was free from petechial fever. Abdominal typhus cases showed a decrease in 1948 of 51.3% compared with 1947, and dysentery of 65.2%. In spite of the most vigorous efforts by the health authorities, the incidence of the above-mentioned diseases has not yet been brought down to the average which obtained over a long period of years before the war. As already stated in the 1947 report, there were many cases of malaria among returned prisoners. This accounts for the increase, which is comparatively small, in that disease. The number of compulsorily notifiable cases of tuberculosis remained generally unchanged as compared with 1947, when infectious tuberculosis of the lungs and throat showed a slight. decrease. The figures for tuberculosis of other organs were a little higher. The civil population, other than hospital patients, continued to suffer from the catastrophic shortage of medicaments, which reached the lowest level of all in the spring of 1946. At this period of acute suffering, UNRRA aid was initiated in April 1946, and later several foreign relief schemes helped to bring about a steady improvement in the supply of drugs, so that we must admit that there is no longer a shortage, although some medicaments are unobtainable. Finally, I should like to mention very briefly that the health authorities in Austria have passed some important laws since the end of the war. The confusion in health matters caused by the German occupation of Austria will have to be overcome, and many laws, decrees and orders of the Ministers of the German Reich, which had been in force in Austria, as well as Austrian health laws will have to be replaced by clear, precise and modern regulations. These aims have not yet, it is true, been achieved, but the results obtained so far are remarkable. Dr. FRÓES (Brazil) (translation from the French) : On behalf of the Brazilian delegation, I desire first of all to express the satisfaction we feel in representing our country at the Second World Health Assembly, which has met in this ancient historic city, the cradle of Western civilization. We should also like to lay before you certain very brief and general considerations on a few important points which are dealt with in the reports under discussion. As Director-General of the Health Services of Brazil, I have followed with the greatest interest the gradual development of WHO, and I do not think I am over-optimistic in expressing my hope and confidence in the future of the Organization. The benefits it can confer will, I have no doubt, be felt not only in Europe, in the countries devastated by the Second World War, but also in the other parts of the world. We feel sure that the help which WHO will be in a position to give such countries will be in keeping with the urgency of their needs. In the introduction to his excellent Report, the Director-General gives an account of the remarkable progress made in regionalization. Mr. PLO JHAR (Czechoslovakia) (translation from the French) : The creation of the World Health Organization, which was the result of action taken by the Economic and Social Council, marks one of the most important stages in the work accomplished by the United Nations since its inception. Think for a moment of our situation at the close of the Second World War. For several years men and women were being killed or maimed. It was absolutely vital to discover a means of effectively aiding the victims of war. That is why we greet the creation of the World Health Organization, which has made its aim the safeguarding of human lives and the bringing of aid to all those whose health has been gravely undermined by the - 95 SIXTH PLENARY MEETING war. This war has not only left sick and wounded behind it ; its influence has been indirectly shown in the undernourishment of children and whole populations, a state of affairs which created favourable conditions for the spread of disease and the sapping of the biological foundation of several generations . Every nation was confronted by the problem of coming swiftly to the succour of human lives. The Czechoslovak Ministry of Health is concerned with problems which, although they do not appear on the list of priorities drawn up by the World Health Organization, are nevertheless urgent for us for reasons we have pointed out. These problems we must solve in the interest of the nation's health. It is more urgent for us to dispose of some public-health problems than to receive good advice. What is more, if we are to make practical use of this advice, certain material pre-conditions must be fulfilled. The teaching of basic subjects, such as biology, biochemistry and biophysics must be developed, and we must also introduce the study of modern anesthesiology in our universities. Our specialists must learn the modern methods of medicine that are being applied in the international field. It is vitally important to place the rearing of guinea-pigs in the hands of our pharmaceutical industry and of our research institutes. Mere advice is not enough for this purpose. We require also, in order to carry out this programme, to be in possession of the necessary apparatus and to obtain animals. In other words, our experts must have all the tools to hand that are indispensable for the carrying-out of their specialized work. The same thing can be said about the production of penicillin. The means of production require to be modernized and we must therefore obtain the necessary apparatus that exists abroad. It should be one of the tasks of the World Health Organization to facilitate the delivery of such apparatus to us. The World Health Organization must consider it its duty to help the various countries by all the means in its power to raise the standard of life of their peoples. Every Member of the Organization must therefore be ready to cooperate fully in accomplishing this task and must place at the disposal of the others its knowledge and possibly its material resources to permit of the achievement of this aim. My country is fully prepared to act on these principles. If the World Health Organization means to make an effective contribution to the solution of the health problems of the various areas and countries, it must give proof of goodwill to translate this wish into concrete terms. It cannot and must not impose its own ideas and plans on the various countries. The World Health Organization must see that the various Member States aid - 96 SIXTH PLENARY MEETING each other in the solution of these problems and that they resort, if need be, to the World Health Organization as an intermediary. Political questions and the interests of private enterprise should not in any way be an obstacle to the realization of this aim. I must unfortunately state that the World Health Organization is in the throes of ideological conflicts. It is being drawn into using its influence on behalf of one of these ideologies. I should like to put you on your guard against the dangers of such a policy, which might result in a split, or even the complete dissolution of this world institution, which can only do effective work if it holds aloof from all conflicts, if it is supported by all countries, and if it takes into account the importance of the special needs of the various countries. We are perturbed by the attitude adopted by the United States to this Organization, in spite of the fact that their nationals play a preponderant part in it. The United States is refusing to grant export licences for Podbielniak extractors and other medical supplies ; and all efforts to obtain them have been without avail. We have here the spectacle of a great Power that talks of aid whilst refusing to furnish machinery, apparatus and other means of saving human life, of saving the lives of mothers, infants and children. On the one hand, this country refuses to come to the aid of children underfed as a result of the war. On the other hand, this same country is ready to help other States, not only by providing them with war material, but also by imposing such aid on them by means of dangerous pacts. We have seen wars enough and do not wish for more. We are confronted by the huge task of succouring the victims of the last war, and already we can see efforts being made which tend to increase the number of these victims. We raise a protest against this policy of duplicity which on the one hand seeks to aid, and on the other to destroy. Those are the points we desired to bring to the attention of the World Health Organization for its consideration. I have dwelt on all that was worthy of praise ; I have also made a critical analysis of what we dislike. The delegates of Czechoslovakia and of the other Popular Democracies desire to collaborate in the great work represented by the World Health Organization, but we categorically demand that the essential claims I have put forward should be admitted, so that the World Health Organization may indeed lend its aid to the various countries, and not allow itself to be drawn into an ideology with which States Members could not agree. If we consider the interests of mankind as supreme ideals, if we really desire to come to the aid of suffering humanity and save millions of mothers and children affected with tuberculosis, cancer and other diseases, if we desire medical science to be familiar with the progress and medical research of each country, then we must set aside all political and ideological differences, for they constitute an impediment to the realization of the supreme ideal which the World Health Organization has set itself. It is only if the fundamental conditions of success are assured that the various governments can agree to their countries remaining within the World Health Organization in order to contribute to its development. Dr. SIMONOITITS (Hungary) : When, a year ago, I had the opportunity of representing the Hungarian Government at the First World Health Assembly, I announced that the Hungarian Government would most willingly join the World Health Organization, being thoroughly convinced that in the field of health there is a great need for co-operation, and being in agreement with the main principles of the Constitution, namely, that threats to health anywhere in the world spell a common danger for the whole of mankind, because health is one and indivisible. Today also, the Hungarian Government's unvaried standpoint is that there is an absolute necessity for international co-operation. But it must be the right kind. It must be said too, truly and sincerely, that the conditions for cooperation have lately become less favourable. We are doctors, and we know well that cure depends upon an exact diagnosis. I think I shall render a good service to WHO, first of all, by pointing out the difficulties with which Hungary, as a small country, has to contend. WHO's assistance is of three kinds : first, granting of fellowships ; second, making books and periodicals available : third, providing lecturers. Hungary attached the greatest importance to fellowships, and precisely in this field found the greatest difficulties. We chose for this purpose, as being suitable to WHO's spirit, -our best scientists and health service organizers who are in leading posts. You know well that there is a popular democracy in Hungary and naturally those leading posts are generally filled by the most enthusiastic followers and workers of the popular democracy and the growing socialism. Lately, it has more and more often happened that those to whom fellowships were granted were refused visas by the very countries which are Members of WHO. It even occurred that a professor of the University of Budapest, officially invited to an international congress in America, did not receive an entry permit. There are difficulties also about receiving books and periodicals. The requested books and periodicals either arrive with great delay or arrive in fragments. We do not even know which books or periodicals we are likely to receive and which we have to procure through other channels. At the beginning, we had great hopes about lecturers. But now, it must be confessed, we have been somewhat disillusioned. Even the best lecturer was hardly more useful than a good article, because in many cases the lecturer had no knowledge of our special local problems. The PRESIDENT : On behalf of the World Health Organization, I have the great honour and pleasure to thank Professor l'Eltore and the Italian AntiTuberculosis Federation. It is a great honour for the World Health Organization that the Forlanini Gold Medal has been bestowed upon the Organization in appreciation of its antituberculosis work. The great Italian scientist and clinician, Carlo Forlanini, was born, as you know, in 1847 and died in 1918. He was the first to propose the artificial pneumothorax as a method for treatment of tuberculosis. His suggestion was met with very heavy criticism indeed, but now it is one of the fundamental methods for the treatment of tuberculosis all over the world. We are very glad indeed that the struggle against tuberculosis, in which WHO is taking part, has been honoured in this way through our Organization, and I can assure you, Professor l'Eltore, that this will encourage our Organization even more to go on with the task of eradicating this scourge from the world. I should like to thank you, and ask you to bring our thanks to the Italian Anti-Tuberculosis Federation. 61. Statement by the Chief Delegate of Belgium The PRESIDENT : I have pleasure in calling upon the chief delegate of Belgium. Professor DE LART (Belgium) (translation from the French) : The Belgian delegation has followed the work of this Second World Health Assembly with keen interest, with the desire to see practical results, and in a spirit of conciliation and justice. As we do not wish to prolong the discussions of the conference unduly and thereby increase the expenditure involved, we decided to take the floor only in order to uphold concrete proposals or to bring forward necessary details. This is why, at the close of the present session, we wish to give our general impression and make a new suggestion. My country is aware that it is the duty of all nations to collaborate in the defence of public health to the fullest extent of their capabilities. Her population, whose very existence has all too often been menaced, is fully conscious of the right to life, recognized as belonging to every human being ; that is to say, the right to defend to the utmost the full development of his personality both in the biological and mental spheres. This right takes precedence over all others and is the condition for their being possible. It is therefore one of the essential foundations of world structure and necessarily implies international solidarity. In the olden days, when a fire broke out in a village, all the citizens formed a chain so as to carry water right to the fire. Anyone who refused to participate in the fight against the fire would have been considered a bad citizen. It is in this spirit that we share the regret expressed here for the abstention of certain members, and the cordially formulated wish to see them reoccupy a place whose prolonged vacancy can only jeopardize the interests of humanity as a whole. The spirit which animated us at New York in 1946, and again last year at Geneva, must again clear the atmosphere of our debates. I sincerely wish this to come about, and I am confident that our united voices will be heard. If I have alluded to the necessity for perfect international understanding in the struggle to improve the health of humanity, it is because this feeling of solidarity indicates the part that Belgium wishes to play in the work of our Organization. My country has made, and is still making, great efforts to maintain a balanced budget, demanding sacrifices from its citizens which frequently make deep inroads into the resources which their work brings them. Our public-health equipment is insufficient, and our budget does not permit us to perfect it as quickly as we should like. If we have sought, during these discussions, to reduce the expenditure submitted for the consideration of this Assembly, it is because of these difficulties. But, on the other hand, we are aware that if resources are insufficient, WHO will not be able to carry out any really effective programme, and that not only its work but in the long run its very existence, subject to the hazards of annual fluctuations and shortsighted projects, would be gradually compromised. Dr. Evang, who is presiding today over our Assembly, demanded last year an effort of the imagination from each one of us for the support, development and success of our health work. I believe that I can reply to this wish by formulating here a new suggestion of principle. You cannot fail to have been struck by the slowness and mediocre results of our discussions whenever they dealt with the establishment of the budget and resources which WHO will have at its disposal in 1950. It was the same last year, and we have every reason to believe that it will be the same in the future, unless we find and adopt other means and other methods. The most serious complaint which I will bring forward is that our methods do not allow us to draw up a real programme of health action with precision and certitude, since every programme of this nature must naturally form part of a plan extending over several years. Under such conditions the World Health Organization will never really accomplish any important work. We must be able to count on assured financial resources, and I see no other means of procuring them than the creation of a world fund for health defence. It would be the responsibility of the Assembly to assign a fraction of this fund, which should not exceed the average percentage based upon the minimum number of years foreseen for the execution of the whole programme, in accordance with that part of the general programme which should prove to be realizable in the course of the forthcoming financial year. - 126 ELEVENTH PLENARY MEETING It is for the financial experts to say how this world health defence fund could be constituted, but we may ask ourselves if it could not be set up by an international loan contracted and managed under the auspices of the International Bank for Reconstruction and Development, under the guarantee of all the Member States of the World Health Organization, each of them contributing, according to the respective coefficients in force, towards the interest charges and amortization of the loan. This contribution would replace in a constant manner that which at present is the subject every year of the difficult discussions with which you are familiar. Having at its disposal a portion of this fund every year, which would thus constitute a kind of ordinary budget, WHO would be able, in addition, to draw on voluntary contributions to obtain the necessary resources for investment, expenditure or any other object which circumstances Might show to be important or urgent. Finally, the fund might be increased or fed by capital transferred from organizations in process of liquidation, or by other contributions, such as, for example, proceeds from World Health Day. We hope that the Director-General will carefully consider this suggestion and study, with the competent experts, the possible ways of realizing it, so that the Third World Health Assembly can examine the results of this investigation and take the decisions it may call for. We have, in this respect, every confidence in Dr. Chisholm, and I take this opportunity of expressing to him our most cordial wish that he may long continue to preside over the work of the remarkable team which he directs with such skill. I am convinced that he would find in the realization of the project which I have just outlined a more certain and effective means of action, and I think that in making such means available to him, the World Health Assembly would be able to fulfil the fundamental aim assigned, to it by its Constitution better in the future than in the past. The Chair recognizes the chief delegate of Bulgaria. Dr. TAGAROFF (Bulgaria) (translation from the Russian) : Before the end of the Second Assembly of our Organization, the Bulgarian delegation feels that it is necessary to make an appraisal of the work of the present Assembly and to state its opinion in this connexion. \" For the decisions and resolutions of the Second Health Assembly given in this document and in document A2/110 Add. 1, see p. 15 There is no doubt that the work accomplished shows many positive aspects. First of all, the drawing-up of a working programme constitutes a positive achievement, although the programme includes a few weak points to which we will return later on. All delegations have concentrated their efforts upon the programme and, in drawing it up, have shown the best of goodwill. The second positive fact is the spirit of conciliation which has manifested itself in many cases during the discussion of certain points. We are convinced that the exchange of views which has taken place in these discussions will contribute towards clarifying and harmonizing the opinions of the various delegations on a series of scientific and medical problems and on questions relating to sanitary organization. It is obvious that personal relationships which have developed between the members of the various delegations also constitute an important positive factor. I hereby declare the Second World Health Assembly closed. The meeting rose at 12.20 p.m. - 135"
and I have tried using code like the following:
speaker_header_pattern <- paste0(
"(",
"(?:\\b[A-Z]{2,}\\b(?:\\s+\\b[A-Z]{2,}\\b){0,4})",
"|",
"(?:Dr|Mr|Mrs|Ms|Prof|Professor)?\\s*",
"[A-Z][a-z]+(?:\\s+[A-Z][a-z]+)*\\s*\\([^)]*\\)",
")",
"\\s*:"
)
sentinel <- "<<>>"
marked_text <- str_replace_all(
full_text,
speaker_header_pattern,
paste0(sentinel, "\\0")
)
raw_turns <- str_split(marked_text, sentinel)[[1]] |>
str_trim() |>
discard(~ .x == "")
speaker_df <- tibble(raw = raw_turns) |>
mutate(
speaker = str_extract(raw, "^.*?:"),
speaker = str_remove(speaker, ":$"),
speaker = str_squish(speaker),
text = str_remove(raw, "^.*?:\\s*"),
text = str_squish(text)
) |>
filter(!is.na(speaker), text != "") |>
mutate(year = year) |>
select(year, speaker, text)
but it never captures all the speakers consistently. Usually speaker turns follow a colon, and and if they are a WHO official they are just the officials position (e.g THE PRESIDENT) but otherwise they may be a name followed by a country (e.g Mr. GREENE (United States of America)). Sometimes they may just be the country, followed by a colon, and usually they are all caps but other times names are not in all caps (e.g Mr. Pozzo (translated from Italian)), and there are other all caps words (e.g DDT) that aren't a speaker. I would go based on colons, but there are other cases where colons do not relate to speaker turns.
How can I create a speaker turn dataframe that correctly identifies the speakers and but is flexible to capture inconsistencies in the text? Even if not perfect, is there an almost universal approach I could use and then manually correct cases where a turn is missing or incorrectly identified? Are there best practices for speaker turn identification from text of this form?