Abstract:
A method of determining the language of a text message received by a mobile telecommunications device indicates receiving an input text message at a mobile telecommunications device; analyzing the input text message using language information stored in the mobile telecommunications device; selecting, from a group of languages defined by the language information, a most likely language for the input text message; and outputting, from the mobile telecommunications device, speech signals corresponding to the input text message, in the selected language.

Description:
FIELD OF THE INVENTION 
   The present invention relates to text language detection, and in particular to methods for detecting the language of text message in a mobile telecommunications system, for example an SMS message, an e-mail or a WAP page. 
   BACKGROUND OF THE INVENTION 
   A Text To Speech (TTS) system is a device for translating text to audio signals. Due to the fast development of the semiconductor industry, these systems are today entering the consumer electronics market. In particular, these systems are today being implemented in Personal Computers (PCs), Personal Digital Assistants (PDAs), Mobile Phones (MPs) and Car Accessories (CAs). 
   One of the most desirable applications for a TTS system is in car hands-free equipment for mobile telephones. Today, mobile phones have the possibility of receiving so-called SMS (short message service) text messages. Through these SMS messages, text can be transmitted to a specific mobile subscriber. The messages can be created and edited, for example, in another mobile telephone or in an e-mail editor at a PC. SMS messages can also be used for transmission of traffic information and other news and data. 
   SMS messages are normally represented in a display of the mobile telephone and the user has to read them from there. However, there are many situations where reading the display can be difficult and even dangerous. In a car hands-free situation, for example, the driver may not be able to read the display contents since he/she has to concentrate on the road. For this reason, there are now law restrictions on using mobile phones while driving. Text to speech conversion is a good solution to overcoming the restriction. The TTS reads the text for the user through the loudspeaker. 
   However, a problem with currently available systems is that they normally support only one language. In some more advanced equipment, the user must choose manually the language to use by the TTS system. However, since different languages have different pronunciations of the alphabet, a message in one language can be unintelligible if spoken by a system designed for another language. 
   It will be readily appreciated that similar comments apply to text received in the form of e-mails, WAP (Wireless Application Protocol) pages or other text systems, in addition to SMS messages. 
   SUMMARY OF THE PRESENT INVENTION 
   One embodiment of the present invention provides means for automatically detecting the incoming language by inspecting statistics of the text. By analyzing text string statistics, for example character frequency and temporal dependency of characters, the language used can be estimated or recognised recognized. This analysis is done before feeding the TTS system with the incoming text string. 
   It is emphasized that the term “comprises” or “comprising” is used in this specification to specify the presence of stated features, integers, steps or components, but does not preclude the addition of one or more further features, integers, steps or components, or groups thereof. 
   According to one aspect of the present invention, there is provided a method of determining the language of a text message received by a mobile telecommunications device, the method comprising: 
   receiving an input text message at a mobile telecommunications device; 
   analyzing the input text message using language information stored in the mobile telecommunications device; 
   selecting, from a group of languages defined by the language information, a most likely language for the input text message; and 
   outputting, from the mobile telecommunications device, speech signals corresponding to the input text message, in the selected language. 
   According to another aspect of the invention, there is provided a method of determining the language of a text message, the method comprising: 
   receiving an input text message comprising a plurality of characters; 
   for each character, except the last in the message, determining respective probability values for selected languages, each probability value being indicative of the probability that the character concerned is followed by the next character in the message in the language concerned; 
   for each language, accumulating the probability values determined for each character in the message; and 
   determining the language of the text message on the basis of the accumulated probability values. 
   According to another aspect of the invention, there is provided a method of determining the language of a text message, the method comprising: 
   receiving an input text message comprising a plurality of characters; 
   defining a plurality of groups of n characters in the message; 
   for each character group, except the last in the message, determining respective probability values for selected languages, each probability value being indicative of the probability that the character group concerned is followed by the next character group in the message in the language concerned; 
   for each language, accumulating the probability values determined for each character group in the message; and 
   determining the language of the text message on the basis of the accumulated probability values. 
   According to another aspect of the invention, there is provided a method of determining the language of an incoming text message, the method comprising: 
   receiving an incoming text message which comprises a plurality of words; 
   comparing each word with each of a plurality of language models relating to respective languages; 
   for each language, recording the number of words that match words stored in the language models; 
   selecting the language of the text message on the basis of the language model having the highest number of word matches. 
   According to another aspect of the invention, there is provided a mobile telecommunications device comprising: 
   a receiver for receiving input text message; 
   a storage unit for storing language information; 
   a text message analyzer for analyzing received input text messages using language information stored in the storage unit; and 
   a speech output unit for outputting speech signals relating to a received input text message, in a language determined by the text message analyzer. 

   
     BRIEF DESCRIPTION OF THE DRAWINGS 
       FIG. 1  illustrates a Discrete Markov Model; 
       FIG. 2  illustrates a language detection apparatus; 
       FIG. 3  illustrates a language detection method; 
       FIG. 4  illustrates a system embodying an aspect of the invention; and 
       FIG. 5  illustrates the operation of the system illustrated in  FIG. 4 . 
   

   DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT 
   In the 1940&#39;s, information theorists discovered that a Discrete Markov Model (DMM) could generate strings of characters that are very similar to the English language, see e.g. Shannon, CE (1948),  A Mathematical theory of Communication , Bell Sys Tech. In the simplest models, a DMM was used where the states S={s i :i=1, . . . , L} represented the set of the L characters of the alphabet S and the transition probabilities 
             {     a     si   ,   sj       }       i   ,     j   =   1       L         
modelled the relative frequency that a character S j  follows a character S i . For example see the transition diagram of  FIG. 1 . In  FIG. 1 , not all possible transitions have been shown in order to improve the clarity of the Figure. Each capital letter (A, B, C . . . ) Represents a state (for single letters the characters themselves), and a i,j  represents the probability of changing from state i to state j.
 
   Better models can be obtained by letting the states represent bigrams or trigrams, i.e. pairs or triplets of characters. In the general case, n-grams, i.e. a group of n characters, can be used. 
   In the present invention these DMM results are used in the opposite direction. That is, a set of DMMs, modeling respective languages, are used to analyze the received text string and calculate which model could have produced the string. Once the appropriate model has been found, the corresponding language is selected for use by the TTS system. 
   Since the mathematics are fundamentally the same, whether the DMM states represents single characters, bigrams or trigrams, the following description of a method embodying the invention relates to the use of single characters. It will be readily appreciated that the description holds for the bigrams, trigrams and n-grams. 
   In mathematical terms, the problem of finding the most probable language can be formulated as follows: 
   Let Λ m , (m=1, . . . , M) represent M different DMMs, each of one representing one of the M specific languages and let ū=[u 1 , . . . u N ] be a vector consisting of N ASCII characters (representing the incoming message). Pr(Λ|ū) is defined to be the probability that a given language was used to generate the incoming text message, conditioned on the knowledge of ū. Then, the maximum a-posteriori language selection {circumflex over (Λ)} is given by solving equation (i): 
   
     
       
         
           
             
               
                 
                   Λ 
                   ^ 
                 
                 = 
                 
                   arg 
                   ⁢ 
                   
                       
                   
                   ⁢ 
                   
                     
                       max 
                       
                         1 
                         ≤ 
                         m 
                         ≤ 
                         M 
                       
                     
                     ⁢ 
                     
                       Pr 
                       ⁡ 
                       
                         ( 
                         
                           
                             Λ 
                             m 
                           
                           | 
                           
                             u 
                             _ 
                           
                         
                         ) 
                       
                     
                   
                 
               
             
             
               
                 (i) 
               
             
           
         
       
     
   
   It will be appreciated that if the string ūhas itself been generated by a DMM that it is possible to show that this is an optimum solution. 
   Using Bayes Theorem for conditional probabilities, the same solution is obtained by solving: 
   
     
       
         
           
             
               
                 
                   
                     Λ 
                     ^ 
                   
                   = 
                   
                     arg 
                     ⁢ 
                     
                         
                     
                     ⁢ 
                     
                       
                         max 
                         
                           1 
                           ≤ 
                           m 
                           ≤ 
                           M 
                         
                       
                       ⁢ 
                       
                         
                           Pr 
                           ⁡ 
                           
                             ( 
                             
                               
                                 u 
                                 _ 
                               
                               | 
                               
                                 Λ 
                                 m 
                               
                             
                             ) 
                           
                         
                         ⁢ 
                         
                           p 
                           ⁡ 
                           
                             ( 
                             
                               Λ 
                               m 
                             
                             ) 
                           
                         
                       
                     
                   
                 
                 , 
               
             
             
               
                 (ii) 
               
             
           
         
       
     
   
   where p(Λ m ) is the a-priori probability than language Λ m  has been used in the generation of u. 
   In order to solve this equation, let 
             {     a     sj   ,   sj       (   m   )       }       i   ,     j   =   1       L         
be the transition probabilities for the language model Λm and q sj   (m)  be the probability that a text string starts in language m with the character s j . Then, we have
 
   
     
       
         
           
             
               
                 
                   Λ 
                   ^ 
                 
                 = 
                 
                   arg 
                   ⁢ 
                   
                       
                   
                   ⁢ 
                   
                     
                       max 
                       
                         1 
                         ≤ 
                         m 
                         ≤ 
                         M 
                       
                     
                     ⁢ 
                     
                       
                         p 
                         ⁡ 
                         
                           ( 
                           
                             Λ 
                             m 
                           
                           ) 
                         
                       
                       ⁢ 
                       
                         q 
                         
                           u 
                           1 
                         
                         
                           ( 
                           m 
                           ) 
                         
                       
                       ⁢ 
                       
                         
                           ∏ 
                           
                             i 
                             = 
                             1 
                           
                           
                             N 
                             - 
                             1 
                           
                         
                         ⁢ 
                         
                             
                         
                         ⁢ 
                         
                           a 
                           
                             
                               u 
                               i 
                             
                             , 
                             
                               u 
                               
                                 i 
                                 + 
                                 1 
                               
                             
                           
                           
                             ( 
                             m 
                             ) 
                           
                         
                       
                     
                   
                 
               
             
             
               
                 ( 
                 iii 
                 ) 
               
             
           
         
       
     
   
   An equivalent solution can be obtained by using the logarithms of the Probabilities (LP). In this case we have equation (iv): 
   
     
       
         
           
             
               
                 
                   Λ 
                   ^ 
                 
                 = 
                 
                   
                     arg 
                     ⁢ 
                     
                         
                     
                     ⁢ 
                     
                       
                         max 
                         
                           1 
                           ≤ 
                           m 
                           ≤ 
                           M 
                         
                       
                       ⁢ 
                       
                         log 
                         ⁡ 
                         
                           ( 
                           
                             p 
                             ⁡ 
                             
                               ( 
                               
                                 Λ 
                                 m 
                               
                               ) 
                             
                           
                           ) 
                         
                       
                     
                   
                   + 
                   
                     log 
                     ⁡ 
                     
                       ( 
                       
                         q 
                         
                           u 
                           1 
                         
                         
                           ( 
                           m 
                           ) 
                         
                       
                       ) 
                     
                   
                   + 
                   
                     
                       ∑ 
                       
                         i 
                         = 
                         1 
                       
                       
                         N 
                         - 
                         1 
                       
                     
                     ⁢ 
                     
                         
                     
                     ⁢ 
                     
                       log 
                       ⁡ 
                       
                         ( 
                         
                           a 
                           
                             
                               u 
                               i 
                             
                             , 
                             
                               u 
                               
                                 i 
                                 + 
                                 1 
                               
                             
                           
                           
                             ( 
                             m 
                             ) 
                           
                         
                         ) 
                       
                     
                   
                 
               
             
             
               
                 ( 
                 iv 
                 ) 
               
             
           
         
       
     
   
   In a practical implementation of the invention, the values of LPs are pre-stored in DMM lookup tables for respective language models. 
     FIG. 2  illustrates a system for detecting the input language and for reading out the text message in the detected language. The system of  FIG. 2  includes a processing unit  2 , a storage unit  4 , an output unit  6  and an output speaker  8 . The processing unit  2  includes a language selection unit  21  which is operable in accordance with the present invention to determine the language of an input text character sequence  u . Operation of the system of  FIG. 2  will now be described with reference to  FIG. 2  and the flowchart of  FIG. 3 . 
   The input character sequence  u  is received by the selection unit  21  (step A), which divides the sequence into a series of n-grams (i.e. groups of n characters) (step B). For the sake of clarity, the system will be described with n=1, i.e. individual characters, but it will be readily appreciated that the number of characters in, a group can be chosen arbitrarily. For example, n=2 or 3 can provide useful results. 
   For each pair of characters (i.e. a character and the next in the sequence), a probability value a i,j  is determined by reference to predefined language models  41  stored in the storage unit  4  (step C). This probability value is indicative of the probability of occurrence of the pair of characters in the language concerned. As described above, the probability values are determined by a discrete Markov model (DMM) of the language concerned. Preferably, the probability values are stored as logarithms of probabilities (LP). 
   The retrieved probability values are accumulated for each language model by the processing unit. In the case of simple probability values, the accumulation is performed according to equation (iii) above. In the preferred embodiment using LPs, the accumulation is performed by using equation (iv) above. When all of the probability values for the character sequence have been accumulated, each language model will have an aggregate probability value. The most likely language is then determined by evaluating equation (iii) or (iv) (step E). The language model that produces the larges accumulated probability value is regarded as the most likely language of the incoming text message. The task of the microprocessor  2  is to accumulate the corresponding probabilities according to the received text string u for all M languages and select the most probable language. Thereafter, the most probable language is selected and the language specific code is chosen for string analysis and conversion. 
   The analysis and conversion unit  22  receives notification of the determined language from the selection unit  21  and then converts the character sequence to appropriate voice signals with reference to language-dependent code  42  stored in the storage unit  4 . The voice signals are then processed by a voice synthesiser  61  (step G) and D/A converter  62  to produce analogue signals suitable for output by a loudspeaker  8  (step H). 
   The size of the DMM tables can be reduced by several ways. The most straightforward method is to translate ū into capital letters prior the probability calculations. Another method is to cluster types of letters (bigrams or trigrams) and let them be presented by one state. 
   It will be readily appreciated that the embodiments described above use conditional probability to determine the most likely language of an incoming text message. The Dmm statistics that are pre-stored are used to determine, for each language, the probability that one character (or group of characters) follows another character (or group). 
   A system embodying another aspect of the present invention is shown in  FIG. 4  and its operation illustrated in  FIG. 5 . The system includes a processor  9  which receives the incoming text message (step A′). A set of language models  10 , such as the Tegic T9™ or Zi Corp™ models, is provided for comparison with the incoming text message. Each word of the text message is compared with the language models  10  (step B′), and the number of matches for each language is recorded (step C′). The language of the text message is then determined to be the language of the model which has the highest number of word matches. Preferably, the text language detection in accordance with this aspect of the invention uses a language model that is already provided in the device. 
   Using a language model which is already available in the device enables the device to be provided with language detection facilities without the need for adding complex processing and algorithms to be provided in the device. Other uses of such models are for text input prediction. Such models tend to be relatively simple dictionaries having the primary purpose of predicting keypad entry of text messages.