Natural Language

RSS for tag

Analyze natural language text and deduce its language-specific metadata using Natural Language.

Posts under Natural Language tag

51 Posts

Post

Replies

Boosts

Views

Activity

Find Semantic Similairity Between Models?
In the video of Explore Natural Language multilingual models https://developer.apple.com/videos/play/wwdc2023/10042/, it's said at 6:24 that there are three models. I wonder if it is possible to find semantic similairity between models? For example English and Japanese belong to different models(Latin and CJK), can we compare the vector produced from the different models to find out if two sentences have similar meanings?
1
0
1.3k
Sep ’23
NLEmbedding not found after updating to iOS 14.4
When I try to get the sentence embedding with NLEmbedding.sentenceEmbedding(for: .english), I get nil returned and the message in the console is: "Unable to locate Asset for contextual word embedding model for local en." I've also tried different languages and also NLEmbedding.wordEmbedding(for: .english) doesn't work. This only occurs on my iPhone X after updating to iOS 14.4. Before it worked fine. It also works on the Simulator on iOS 14.4. Did somebody face a similar problem? Or does somebody know how to force iOS to download these embeddings again?
4
1
2.8k
Jul ’23
NaturalLanguage, Named Entity recognition not working anymore in
The code https://developer.apple.com/documentation/naturallanguage/identifying_people_places_and_organizations works on Swift Playground 4.3.1 under iPad OS but under XCode 14.3.1 the named entities are not recognized and for every word I get: ["Other": 1.0]. Strangely, I had the code work in an iOS App under XCode 14.3.1 but there seems to be some level of unpredictability as to when it works or not. Any hints?
0
1
864
Jul ’23
NaturalLanguage Example Code not working
I am examining the ability of NaturalLanguage to identify placeNames. I ran across the example code in the developer documentation here: https://developer.apple.com/documentation/naturallanguage/identifying_people_places_and_organizations When I execute this example exactly as stated it does not function as expected. Running Xcode 14.3.1 on macOS Ventura 13.4. The code does not find a single tag of any kind in the sample text. Can someone offer an explanation?
1
0
1.2k
Jun ’23
Natural language word segmentation.
Hi community. I was looking for a way to make word segmentation of a string without delimiters and spaces. Apple's Natural language framework does not provide this (I think is strange). I want to achieve something like this: Input: "makesenseofthis" Output: ["make", "sense", "of", "this"] Any third party to do it? Maybe is there any Apple API? Thanks in advance
0
0
1.5k
Jun ’23
Word tagging tools for CreateML?
What tools are folks using to create the json file needed to train a custom word tagger model? I've tried Doccano, but it exports JSONL which is very different than what CreateML is expecting. (example of the required format here: https://developer.apple.com/documentation/naturallanguage/creating_a_word_tagger_model). Are there standard tools or utilities that export/convert to the CreateML format? Thanks.
2
0
2.8k
Apr ’23
ECG Anomaly Dataset
I am a undergraduate research student at a university lab. I am looking to find raw data for the anomaly detection of ECG measured by the apple watch. I understand that Healthkit provides a visual graph of the ECG data. However, I am in need of the numerical data for research purposes. Is there a way for me to get to this dataset?
2
0
2.1k
Mar ’23
iOS 16 TTS is horrible, it doesn’t work!
iOS 15 Siri voices worked perfectly. However, iOS 16 has a lot of issues - such as skipping words and sentences, and stopping reading all together. Obviously, this is a problem with the TTS I myself use Siri to read books while driving, but I regret updating to iOS 16. I went as far as upgrading my iPhone SE to my iPhone 14 Pro thinking it was the memory issue, but it's the same issue on both phones even my Mac M1 Pro with 16Gigs has same issues. https://youtu.be/g58nbW4J0DY It would be nice to receive and update or even a roll back to iOS 15 state of TTS
3
1
2.5k
Jan ’23
How to get auto-suggested word based on drawn Chinese character or stroke info in the form of an array of CGPoint?
I have an array consists of the CGPoint representing the chinese character stroke paths and able to re-draw out the character on UIView. I would like to use this existing information to find out the most similar chinese word. I notice the chinese keyboard hand-writing pad can display the suggested words. However, I have no idea which functions in the documentation that get this to work ( pass the stroke info as CGPoint, and get back suggested Chinese words). What API calls can I use to get the suggested words?
0
0
1.7k
Aug ’22
How to validate NLLanguage values for NLLanguageRecognizer?
I expected the initializer NLLanguage(rawValue: "...") to return nil if I gave it junk, but it doesn't. It accepts any string. I'm loading values from a database so I'd like to know if I'm getting one that is valid, like "en", "es", etc., as opposed to an error. Is there anyway to check that? I'm using it to set NLLanguageRecognizer.languageConstraints, so I guess by "valid" I mean all the languages that work with that property. The struct has a bunch of static constants: struct NLLanguage { static let english = ... static let spanish = ... ... } If those all work with NLLanguageRecognizer I guess I can paste them all into a dictionary.
0
0
1.2k
Jul ’22
Parse data from natural language text using SiriKit
I want to add a feature where a user can type a request using natural language to trigger different actions within my app (eg. "Create an assignment due tomorrow at midnight", "Create a high priority assignment called Final Presentation"). I'd like to leverage SiriKit to process this text, parse the data, and handle the response like I would if the user had asked Siri. First, is this even possible to do? Second, if not what other technologies could I use to parse natural language text?
1
0
1.5k
Jul ’22
Use of Apples Thesaurus & Translator
Hey, I’m wondering if it’s possible to use the Translation service by Apple when selecting text like it’s possible in safari or other apps developed by apple. For example in notes or others you can select text and hit the translate button, which shows the translation to the systems language as far as I know. My question now is if it is possible to also provide this feature in my own app. To be more specific, having a selectable text view , then being able to translate this wording and maybe even get the results not only shown to the user himself but returning the translation to my own app for further processes … as far as I know, the standard dictionary entries are provided by Oxford or in Germany by Duden api services. Is it even possible to the app to choose which service to use and another question: is it possible to customize the options popping up when text is selected? (The view where also “copy”,”paste”,”cut”…. Is shown -> extend options with “translate”? Many thanks for your help. Unfortunately, I haven’t found an answer to those questions. My only thought has been to use external api by Oxford etc but first I would like to be in knowledge of the possibility or unavailability of the given service already implemented by apple to iOS and macOS devices. Have a great day. À bientôt
3
0
2.8k
Jun ’22
Could string ranges obtained with a MLTokenizer be used outside of the enumerateTokens loop?
With the following function I sometime get "Thread 1: Fatal error: String index is out of bounds" errors at the substring.shuffled() call.  func transform(_ text: String) -> String {         var transformed = text         if #available(macOS 10.14, iOS 12.0, *) {             print("text: \"\(text)\"")             var wordRanges: [Range<String.Index>] = []             let tokenizer = NLTokenizer(unit: .word)             tokenizer.string = transformed             tokenizer.enumerateTokens(in: transformed.startIndex..<transformed.endIndex) { range, _ in                 if transformed[range].count > 3 {                     let subrange = transformed.index(range.lowerBound, offsetBy: 1)..<transformed.index(range.upperBound, offsetBy: -1)                     wordRanges.append(subrange)                 }                 return true             }             wordRanges.reversed().forEach { range in                 let substring = String(transformed[range])                 print("substring: \"\(substring)\"")                 transformed.replaceSubrange(range, with: substring.shuffled())             }         } else {             let range = NSRange(transformed.startIndex..., in: transformed)             let regex = try! NSRegularExpression(pattern: "\\W?\\w(\\w+)\\w\\W?", options: [])             let matches = regex.matches(in: transformed, options: [], range: range)             matches.reversed().forEach { match in                 guard let subrange = Range(match.range(at: 1), in: transformed) else {                     return                 }                 let substring = transformed[subrange]                 transformed.replaceSubrange(subrange, with: substring.shuffled())             }         }         return transformed     } The error appear in a macOS app with some strings but not all. I can't reproduce the error in a playground with the string that triggered the error. When the error occurs, tprinted substrings are not correct. Using Xcode 13.3.
1
0
1.3k
Mar ’22
Find Semantic Similairity Between Models?
In the video of Explore Natural Language multilingual models https://developer.apple.com/videos/play/wwdc2023/10042/, it's said at 6:24 that there are three models. I wonder if it is possible to find semantic similairity between models? For example English and Japanese belong to different models(Latin and CJK), can we compare the vector produced from the different models to find out if two sentences have similar meanings?
Replies
1
Boosts
0
Views
1.3k
Activity
Sep ’23
NLEmbedding not found after updating to iOS 14.4
When I try to get the sentence embedding with NLEmbedding.sentenceEmbedding(for: .english), I get nil returned and the message in the console is: "Unable to locate Asset for contextual word embedding model for local en." I've also tried different languages and also NLEmbedding.wordEmbedding(for: .english) doesn't work. This only occurs on my iPhone X after updating to iOS 14.4. Before it worked fine. It also works on the Simulator on iOS 14.4. Did somebody face a similar problem? Or does somebody know how to force iOS to download these embeddings again?
Replies
4
Boosts
1
Views
2.8k
Activity
Jul ’23
NaturalLanguage, Named Entity recognition not working anymore in
The code https://developer.apple.com/documentation/naturallanguage/identifying_people_places_and_organizations works on Swift Playground 4.3.1 under iPad OS but under XCode 14.3.1 the named entities are not recognized and for every word I get: ["Other": 1.0]. Strangely, I had the code work in an iOS App under XCode 14.3.1 but there seems to be some level of unpredictability as to when it works or not. Any hints?
Replies
0
Boosts
1
Views
864
Activity
Jul ’23
NaturalLanguage Example Code not working
I am examining the ability of NaturalLanguage to identify placeNames. I ran across the example code in the developer documentation here: https://developer.apple.com/documentation/naturallanguage/identifying_people_places_and_organizations When I execute this example exactly as stated it does not function as expected. Running Xcode 14.3.1 on macOS Ventura 13.4. The code does not find a single tag of any kind in the sample text. Can someone offer an explanation?
Replies
1
Boosts
0
Views
1.2k
Activity
Jun ’23
Natural language word segmentation.
Hi community. I was looking for a way to make word segmentation of a string without delimiters and spaces. Apple's Natural language framework does not provide this (I think is strange). I want to achieve something like this: Input: "makesenseofthis" Output: ["make", "sense", "of", "this"] Any third party to do it? Maybe is there any Apple API? Thanks in advance
Replies
0
Boosts
0
Views
1.5k
Activity
Jun ’23
Word tagging tools for CreateML?
What tools are folks using to create the json file needed to train a custom word tagger model? I've tried Doccano, but it exports JSONL which is very different than what CreateML is expecting. (example of the required format here: https://developer.apple.com/documentation/naturallanguage/creating_a_word_tagger_model). Are there standard tools or utilities that export/convert to the CreateML format? Thanks.
Replies
2
Boosts
0
Views
2.8k
Activity
Apr ’23
ECG Anomaly Dataset
I am a undergraduate research student at a university lab. I am looking to find raw data for the anomaly detection of ECG measured by the apple watch. I understand that Healthkit provides a visual graph of the ECG data. However, I am in need of the numerical data for research purposes. Is there a way for me to get to this dataset?
Replies
2
Boosts
0
Views
2.1k
Activity
Mar ’23
iOS 16 TTS is horrible, it doesn’t work!
iOS 15 Siri voices worked perfectly. However, iOS 16 has a lot of issues - such as skipping words and sentences, and stopping reading all together. Obviously, this is a problem with the TTS I myself use Siri to read books while driving, but I regret updating to iOS 16. I went as far as upgrading my iPhone SE to my iPhone 14 Pro thinking it was the memory issue, but it's the same issue on both phones even my Mac M1 Pro with 16Gigs has same issues. https://youtu.be/g58nbW4J0DY It would be nice to receive and update or even a roll back to iOS 15 state of TTS
Replies
3
Boosts
1
Views
2.5k
Activity
Jan ’23
Euskara - Basque language.
It would be great to be able to use all the software in our mother language. I've spent so many years waiting for the S.W to be in basque. We are many people wating for it. I will love helping our dream come true.
Replies
3
Boosts
0
Views
2.4k
Activity
Jan ’23
Source code for demo project
Is it possible to get the source code for the sample projects used in the demo of the WWDC 2020 Session "Make apps smarter with Natural Language". Nosh, Verse, Merch. Would like to use it for reference purposes.
Replies
0
Boosts
0
Views
956
Activity
Dec ’22
WeatherKit conditionCode - sleet
One of the possible values of the forecast property conditionCode is sleet. But according to wikipedia this term refers to multiple, quite different weather phenomena. Some harmless and other potentially hazardous. What type of weather does sleet refer to in the weatherKit API?
Replies
5
Boosts
0
Views
1.9k
Activity
Oct ’22
How to get auto-suggested word based on drawn Chinese character or stroke info in the form of an array of CGPoint?
I have an array consists of the CGPoint representing the chinese character stroke paths and able to re-draw out the character on UIView. I would like to use this existing information to find out the most similar chinese word. I notice the chinese keyboard hand-writing pad can display the suggested words. However, I have no idea which functions in the documentation that get this to work ( pass the stroke info as CGPoint, and get back suggested Chinese words). What API calls can I use to get the suggested words?
Replies
0
Boosts
0
Views
1.7k
Activity
Aug ’22
How to validate NLLanguage values for NLLanguageRecognizer?
I expected the initializer NLLanguage(rawValue: "...") to return nil if I gave it junk, but it doesn't. It accepts any string. I'm loading values from a database so I'd like to know if I'm getting one that is valid, like "en", "es", etc., as opposed to an error. Is there anyway to check that? I'm using it to set NLLanguageRecognizer.languageConstraints, so I guess by "valid" I mean all the languages that work with that property. The struct has a bunch of static constants: struct NLLanguage { static let english = ... static let spanish = ... ... } If those all work with NLLanguageRecognizer I guess I can paste them all into a dictionary.
Replies
0
Boosts
0
Views
1.2k
Activity
Jul ’22
Parse data from natural language text using SiriKit
I want to add a feature where a user can type a request using natural language to trigger different actions within my app (eg. "Create an assignment due tomorrow at midnight", "Create a high priority assignment called Final Presentation"). I'd like to leverage SiriKit to process this text, parse the data, and handle the response like I would if the user had asked Siri. First, is this even possible to do? Second, if not what other technologies could I use to parse natural language text?
Replies
1
Boosts
0
Views
1.5k
Activity
Jul ’22
Use of Apples Thesaurus & Translator
Hey, I’m wondering if it’s possible to use the Translation service by Apple when selecting text like it’s possible in safari or other apps developed by apple. For example in notes or others you can select text and hit the translate button, which shows the translation to the systems language as far as I know. My question now is if it is possible to also provide this feature in my own app. To be more specific, having a selectable text view , then being able to translate this wording and maybe even get the results not only shown to the user himself but returning the translation to my own app for further processes … as far as I know, the standard dictionary entries are provided by Oxford or in Germany by Duden api services. Is it even possible to the app to choose which service to use and another question: is it possible to customize the options popping up when text is selected? (The view where also “copy”,”paste”,”cut”…. Is shown -> extend options with “translate”? Many thanks for your help. Unfortunately, I haven’t found an answer to those questions. My only thought has been to use external api by Oxford etc but first I would like to be in knowledge of the possibility or unavailability of the given service already implemented by apple to iOS and macOS devices. Have a great day. À bientôt
Replies
3
Boosts
0
Views
2.8k
Activity
Jun ’22
Sample code for WWDC20 NLP session
I am not able to locate the sample code used in the below NLP session. Can someone point me to the same . Thanks https://developer.apple.com/videos/play/wwdc2020/10657/
Replies
0
Boosts
0
Views
1.4k
Activity
May ’22
How to create/train sentence embedding model
I have a file of a few thousand sentences I'd like to convert into something that NLEmbedding can use. (In searching around it looks like none of the sample code for "Make Apps Smarter with Natural Language" from WWDC 2020 was ever released.) Can anyone put me on the right track on how to do this?
Replies
1
Boosts
0
Views
1.5k
Activity
May ’22
Probably very beginner metadata inquiry
I am trying to view and read metadata for audio and videos, such as modifications made if any- can someone tell me how to get there? Thanks in advance
Replies
0
Boosts
0
Views
695
Activity
Apr ’22
Could string ranges obtained with a MLTokenizer be used outside of the enumerateTokens loop?
With the following function I sometime get "Thread 1: Fatal error: String index is out of bounds" errors at the substring.shuffled() call.  func transform(_ text: String) -> String {         var transformed = text         if #available(macOS 10.14, iOS 12.0, *) {             print("text: \"\(text)\"")             var wordRanges: [Range<String.Index>] = []             let tokenizer = NLTokenizer(unit: .word)             tokenizer.string = transformed             tokenizer.enumerateTokens(in: transformed.startIndex..<transformed.endIndex) { range, _ in                 if transformed[range].count > 3 {                     let subrange = transformed.index(range.lowerBound, offsetBy: 1)..<transformed.index(range.upperBound, offsetBy: -1)                     wordRanges.append(subrange)                 }                 return true             }             wordRanges.reversed().forEach { range in                 let substring = String(transformed[range])                 print("substring: \"\(substring)\"")                 transformed.replaceSubrange(range, with: substring.shuffled())             }         } else {             let range = NSRange(transformed.startIndex..., in: transformed)             let regex = try! NSRegularExpression(pattern: "\\W?\\w(\\w+)\\w\\W?", options: [])             let matches = regex.matches(in: transformed, options: [], range: range)             matches.reversed().forEach { match in                 guard let subrange = Range(match.range(at: 1), in: transformed) else {                     return                 }                 let substring = transformed[subrange]                 transformed.replaceSubrange(subrange, with: substring.shuffled())             }         }         return transformed     } The error appear in a macOS app with some strings but not all. I can't reproduce the error in a playground with the string that triggered the error. When the error occurs, tprinted substrings are not correct. Using Xcode 13.3.
Replies
1
Boosts
0
Views
1.3k
Activity
Mar ’22
Language translator offline
I want to add a feature in-app language translation offline. If anyone has any idea kindly guide me.
Replies
2
Boosts
0
Views
946
Activity
Feb ’22