How to load the letter and their log probabilities in database.txt into our program?
1 回表示 (過去 30 日間)
古いコメントを表示
I have a txt file and I need to add this txt file into my program to access the unigram and bigram database.
Is there any way I could load it into the program directly without hardcoding/copy and paste?
***********************************************************
**** This table is the log_2
**** probability of letter unigrams
**** i.e., log_2(p('a letter'))
**** Note: the unigram and probability are tab delimited
***********************************************************
a -3.561879942602564
b -6.036018896964266
c -4.9663355149956425
***********************************************************
**** This table is the log_2
**** probability of letter bigrams
**** i.e., log_2(p('first letter, second letter'))
**** Note: the bigram and probability are tab delimited
***********************************************************
aa -11.077395929707704
ab -9.279102981402742
ac -7.9797285896725825
ad -8.160340354667962
ae -11.752348492976163
0 件のコメント
採用された回答
Jeff Miller
2020 年 4 月 4 日
This function on FileExchange simply returns a long list of all the numbers in the file. Since it looks like your file has the numbers in a pre-determined order with no extraneous numbers, it might do what you want.
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Database Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!