Dear STATALISTs,
to evaluate LDA topic models; I intend to code their semantic coherence. (formula on page 265 here: Optimizing Semantic Coherence in Topic Models (umass.edu); and/or image at the bottom)
First, I need to compute a co-occurrence matrix. In a long string (text_strings_I; roughly 40.000 obs), I need to compute the (1) occurrence of each word, and (2) the co-occurence with each other word within a given topic.
Below you find the structure of my data: i.e. the top 10 words for a number of topics (here 10, eventually increasing by 10 up till 50).
Unfortunately, nooccur doesn't do the trick, because I can only insert an explicit string into the bracket, at least to my knowledge.
forvalues i=1/10 {
egen occ_top`i' = noccur(text_strings_I), string(topic`i'[`i'[])
}
How can I compute the co-occurance matrix for each topic? How can I save them using tempfiles to aggregate them to the semantic coherence score for each topic (formula in the picture below)?
Many thanks in advance for your thoughts and considerations, greatly appreciated.
Sven Uwe
to evaluate LDA topic models; I intend to code their semantic coherence. (formula on page 265 here: Optimizing Semantic Coherence in Topic Models (umass.edu); and/or image at the bottom)
First, I need to compute a co-occurrence matrix. In a long string (text_strings_I; roughly 40.000 obs), I need to compute the (1) occurrence of each word, and (2) the co-occurence with each other word within a given topic.
Below you find the structure of my data: i.e. the top 10 words for a number of topics (here 10, eventually increasing by 10 up till 50).
Unfortunately, nooccur doesn't do the trick, because I can only insert an explicit string into the bracket, at least to my knowledge.
forvalues i=1/10 {
egen occ_top`i' = noccur(text_strings_I), string(topic`i'[`i'[])
}
How can I compute the co-occurance matrix for each topic? How can I save them using tempfiles to aggregate them to the semantic coherence score for each topic (formula in the picture below)?
Many thanks in advance for your thoughts and considerations, greatly appreciated.
Sven Uwe
topic1 | topic2 | topic3 | topic4 | topic5 | topic6 | topic7 | topic8 | topic9 | topic10 | text_strings_I | |
entwicklung | optisch | vorhaben | entwicklung | zwanzig20 | entwicklung | forschungsprmi | verbundvorhaben | verbundvorhaben | entwicklung | ERA-IB 5 MetaCat - Neue und hocheffiziente Biokatalysatoren metagenomischen Ursprungs für die industrielle Biotechnologie evocatal | |
kmuinnovativ | untersuchungen | modellierung | wachstumskern | verbundvorhaben | herstellung | international | entwicklung | nachhaltig | innoregio | ERA Net EuroTransBio-1 Entwicklung eines neuen Helicobacter pylori antigen Test | |
basi | grundlegend | analys | spitzenclust | wachstumskern | fertigung | forschung | kmuinnovativ | entwicklung | intelligent | ERA-IB Pseudomonas 2 0 Industrielle Biokatalyse mit lebenden Zellen TP 2 | |
herstellung | komponenten | untersuchung | analys | entwicklung | kmuinnovativ | verbundvorhaben | klimaschutz | innov | system | ERA-NET EuroTransBio-10 Light-Up-Im Projekt Light-Up wir eine zentrifugal-mikrofluidische Plattform LabDisk für die Therapiebegleitene HIV- und HTLV-Diagnostik entwickelt | |
materialien | entwicklung | untersuchungen | diagnostik | tp1 | verbundvorhaben | forschungsprmiezwei | integriert | handwerk | produkt | text_strings_I | |
neuartig | anwendungen | simul | verbund | tp2 | addit | deutschland | ressourceneffizienz | stadt | mobil | ERA-NET EuroTransBio-10 Light-Up-Im Projekt Light-Up wir eine zentrifugal-mikrofluidische Plattform LabDisk für die Therapiebegleitene HIV- und HTLV-Diagnostik entwickelt | |
erforschung | erforschung | wtz | grundlagen | smart | bauteil | rahmen | herstellung | umsetzung | integr | ERA-IB 4 Anthoplus - Produktion von Anthocyanen in spezialisierten Zellkultursystemen IPK | |
organisch | basi | einfluss | innoregio | tp3 | integr | durchfhrung | verfahren | dienstleistungen | konzept | Planung Durchführung und Nachbereitung von Veranstaltungen zur Anbahnung einer deutsch-chinesischen Kooperation in der Biotechnologie | |
verbundvorhaben | grundlagen | auswirkungen | charakterisierung | tp4 | prozesskett | bereich | umweltschutz | zukunft | methoden | Bioökonomie International 2015 Bio-HiPe-Composite - Entwicklung biobasierter Komposite als technische Kunststoffe für Anwendungen im Automobilbereich - TP Fh-UMSICHT | |
innov | neuartig | modul | detekt | carbon | verfahren | validierung | rohstoff | firmenvorhaben | werkzeug | EMIDA ERA-Net MADISPREAD - Die Ausbreitung und Evolution des Virus der Marekschen Krankheit MDV in der Hühnerpopulation - A | |
ERA-IB 5 MetaCat - Eine Sammlung metagenomischer neuartiger und hocheffizienter Biokatalysatoren für die industrielle Biotechnologie Uni Hamburg | |||||||||||
Bioökonomie International 2014 CAMPY-TRACE - Kombinierte Real-time PCR mit lebend/tot Unterscheidung zur quantitativen Risikobewertung lebender Campylobacter anwendbar für internationale Kontrollstrategien A | |||||||||||
ERA-IB 7 TIPs - Thermostabile Isomerasen in der Biotechnologie |