Skip to content
  • Categories
  • Recent
  • Popular
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

NodeBB-ActivityPub Bridge Test Instance

  1. Home
  2. Categories
  3. General Discussion
  4. AP Test (community.nodebb.org)
  5. Slightly better titles from fediverse topics

Slightly better titles from fediverse topics

Scheduled Pinned Locked Moved AP Test (community.nodebb.org)
activitypub
10 Posts 6 Posters 160 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • julian@community.nodebb.orgJ This user is from outside of this forum
    julian@community.nodebb.orgJ This user is from outside of this forum
    julian@community.nodebb.org
    wrote on last edited by
    #1

    An update from last night brings some additional logic to the title generation of topics from the fediverse.

    Previously if a title was provided in the name property, that was used as the topic title.

    While that hasn't changed (and is the strongest signal for a topic title), not all fediverse content contains titles. Specifically, Mastodon posts do not require or even have a space to put a title in.

    For those cases, we fall back to generating one based on the content. We literally grabbed the first 128 characters or so, and added an ellipsis to the end.

    While that worked okay as a stopgap, it meant that a lot of topics ended up with really long titles — not ideal.

    The new logic tries to grab the first line of text (either the first <p> or line), and from there, the first sentence, using some naive regular expressions.

    While still not a proper alternative to... you know... specifying a title, it's better than nothing I suppose!

    I wonder if other fediverse softwares implement title generation logic like this...

    jupiter_rowland@hub.netzgemeinde.euJ rimu@mastodon.nzoss.nzR crazycells@community.nodebb.orgC mikedev@fediversity.siteM 4 Replies Last reply
    0
    • julian@community.nodebb.orgJ julian@community.nodebb.org

      An update from last night brings some additional logic to the title generation of topics from the fediverse.

      Previously if a title was provided in the name property, that was used as the topic title.

      While that hasn't changed (and is the strongest signal for a topic title), not all fediverse content contains titles. Specifically, Mastodon posts do not require or even have a space to put a title in.

      For those cases, we fall back to generating one based on the content. We literally grabbed the first 128 characters or so, and added an ellipsis to the end.

      While that worked okay as a stopgap, it meant that a lot of topics ended up with really long titles — not ideal.

      The new logic tries to grab the first line of text (either the first <p> or line), and from there, the first sentence, using some naive regular expressions.

      While still not a proper alternative to... you know... specifying a title, it's better than nothing I suppose!

      I wonder if other fediverse softwares implement title generation logic like this...

      jupiter_rowland@hub.netzgemeinde.euJ This user is from outside of this forum
      jupiter_rowland@hub.netzgemeinde.euJ This user is from outside of this forum
      jupiter_rowland@hub.netzgemeinde.eu
      wrote on last edited by
      #2
      @julian What Lemmy understands is this:

      Title

      @Community

      Post body

      It was added back in the day to make it possible for Mastodon users to start new threads in connected Lemmy communities.

      #FediMeta #FediverseMeta #CWFediMeta #CWFediverseMeta
      julian@community.nodebb.orgJ 1 Reply Last reply
      0
      • julian@community.nodebb.orgJ julian@community.nodebb.org

        An update from last night brings some additional logic to the title generation of topics from the fediverse.

        Previously if a title was provided in the name property, that was used as the topic title.

        While that hasn't changed (and is the strongest signal for a topic title), not all fediverse content contains titles. Specifically, Mastodon posts do not require or even have a space to put a title in.

        For those cases, we fall back to generating one based on the content. We literally grabbed the first 128 characters or so, and added an ellipsis to the end.

        While that worked okay as a stopgap, it meant that a lot of topics ended up with really long titles — not ideal.

        The new logic tries to grab the first line of text (either the first <p> or line), and from there, the first sentence, using some naive regular expressions.

        While still not a proper alternative to... you know... specifying a title, it's better than nothing I suppose!

        I wonder if other fediverse softwares implement title generation logic like this...

        rimu@mastodon.nzoss.nzR This user is from outside of this forum
        rimu@mastodon.nzoss.nzR This user is from outside of this forum
        rimu@mastodon.nzoss.nz
        wrote on last edited by
        #3

        @julian PieFed uses the first 150 chars of the first line, but stopping at the first '.' in the first line makes even more sense.

        julian@community.nodebb.orgJ 1 Reply Last reply
        0
        • julian@community.nodebb.orgJ julian@community.nodebb.org

          An update from last night brings some additional logic to the title generation of topics from the fediverse.

          Previously if a title was provided in the name property, that was used as the topic title.

          While that hasn't changed (and is the strongest signal for a topic title), not all fediverse content contains titles. Specifically, Mastodon posts do not require or even have a space to put a title in.

          For those cases, we fall back to generating one based on the content. We literally grabbed the first 128 characters or so, and added an ellipsis to the end.

          While that worked okay as a stopgap, it meant that a lot of topics ended up with really long titles — not ideal.

          The new logic tries to grab the first line of text (either the first <p> or line), and from there, the first sentence, using some naive regular expressions.

          While still not a proper alternative to... you know... specifying a title, it's better than nothing I suppose!

          I wonder if other fediverse softwares implement title generation logic like this...

          crazycells@community.nodebb.orgC This user is from outside of this forum
          crazycells@community.nodebb.orgC This user is from outside of this forum
          crazycells@community.nodebb.org
          wrote on last edited by
          #4

          @julian thanks Julian! what about AI-backed title generation with character limitation?

          for example, I put your post here: https://seo.ai/tools/ai-title-generator

          and got this:

          Screenshot 2024-04-30 at 16.53.22.png

          not bad I guess...

          I love "topic sentences" 😄 and try to use it when I start a new topic, but unfortunately they are not commonly used by others.

          julian@community.nodebb.orgJ 1 Reply Last reply
          0
          • crazycells@community.nodebb.orgC crazycells@community.nodebb.org

            @julian thanks Julian! what about AI-backed title generation with character limitation?

            for example, I put your post here: https://seo.ai/tools/ai-title-generator

            and got this:

            Screenshot 2024-04-30 at 16.53.22.png

            not bad I guess...

            I love "topic sentences" 😄 and try to use it when I start a new topic, but unfortunately they are not commonly used by others.

            julian@community.nodebb.orgJ This user is from outside of this forum
            julian@community.nodebb.orgJ This user is from outside of this forum
            julian@community.nodebb.org
            wrote on last edited by
            #5

            @crazycells no, I will never use AI for this purpose.

            Because the resulting content is in the title, it would be implicitly misattributed to the topic author, without their consent.

            1 Reply Last reply
            0
            • jupiter_rowland@hub.netzgemeinde.euJ jupiter_rowland@hub.netzgemeinde.eu
              @julian What Lemmy understands is this:

              Title

              @Community

              Post body

              It was added back in the day to make it possible for Mastodon users to start new threads in connected Lemmy communities.

              #FediMeta #FediverseMeta #CWFediMeta #CWFediverseMeta
              julian@community.nodebb.orgJ This user is from outside of this forum
              julian@community.nodebb.orgJ This user is from outside of this forum
              julian@community.nodebb.org
              wrote on last edited by
              #6

              @jupiter_rowland@hub.netzgemeinde.eu said in Slightly better titles from fediverse topics:

              Title@CommunityPost body

              Thanks, I hate it.

              I should say, rather, that I get why it was done, and bonus points for just getting it done, but it reads like so much like "hack it until it works" methodology that I feel like we ought to be better than that by now.

              1 Reply Last reply
              0
              • rimu@mastodon.nzoss.nzR rimu@mastodon.nzoss.nz

                @julian PieFed uses the first 150 chars of the first line, but stopping at the first '.' in the first line makes even more sense.

                julian@community.nodebb.orgJ This user is from outside of this forum
                julian@community.nodebb.orgJ This user is from outside of this forum
                julian@community.nodebb.org
                wrote on last edited by
                #7

                @rimu@mastodon.nzoss.nz said in Slightly better titles from fediverse topics:

                I like your method of stopping at the first '.', that would yield better results more often.

                Thanks, it worked decently until I remembered that there were additional punctuation marks besides the lowly period.

                So I had to add in support for ? and !, and update the logic to actually add those punctuation marks back in to the title.

                ... and yet there are more edge cases... some bot accounts post a title-esque first line along with a link, which needs to be teased out.

                scott@authorship.studioS rimu@mastodon.nzoss.nzR 2 Replies Last reply
                0
                • julian@community.nodebb.orgJ julian@community.nodebb.org

                  @rimu@mastodon.nzoss.nz said in Slightly better titles from fediverse topics:

                  I like your method of stopping at the first '.', that would yield better results more often.

                  Thanks, it worked decently until I remembered that there were additional punctuation marks besides the lowly period.

                  So I had to add in support for ? and !, and update the logic to actually add those punctuation marks back in to the title.

                  ... and yet there are more edge cases... some bot accounts post a title-esque first line along with a link, which needs to be teased out.

                  scott@authorship.studioS This user is from outside of this forum
                  scott@authorship.studioS This user is from outside of this forum
                  scott@authorship.studio
                  wrote on last edited by
                  #8
                  @julian
                  ...not all fediverse content contains titles. Specifically, Mastodon posts do not require or even have a space to put a title in.

                  Hubzilla dealt with that issue by putting the title of the post in the post itself, so people on Mastodon and other platforms could see the title. So the title is transmitted in both the title field, and in the body field. It looks redundant, but I see what they did it that way, especially since Mastodon is so dominant in the space.
                  1 Reply Last reply
                  0
                  • julian@community.nodebb.orgJ julian@community.nodebb.org

                    An update from last night brings some additional logic to the title generation of topics from the fediverse.

                    Previously if a title was provided in the name property, that was used as the topic title.

                    While that hasn't changed (and is the strongest signal for a topic title), not all fediverse content contains titles. Specifically, Mastodon posts do not require or even have a space to put a title in.

                    For those cases, we fall back to generating one based on the content. We literally grabbed the first 128 characters or so, and added an ellipsis to the end.

                    While that worked okay as a stopgap, it meant that a lot of topics ended up with really long titles — not ideal.

                    The new logic tries to grab the first line of text (either the first <p> or line), and from there, the first sentence, using some naive regular expressions.

                    While still not a proper alternative to... you know... specifying a title, it's better than nothing I suppose!

                    I wonder if other fediverse softwares implement title generation logic like this...

                    mikedev@fediversity.siteM This user is from outside of this forum
                    mikedev@fediversity.siteM This user is from outside of this forum
                    mikedev@fediversity.site
                    wrote on last edited by
                    #9
                    Best of luck. We gave up trying to force or generate a title back in 2010, because some posts are nothing but a photo or video. And as you noticed titles are somewhat incompatible with the microblog side of the fediverse. If your own software requires a title you're probably stuck in some cases where you can't extract words from the content with something like '[unknown title]'.
                    1 Reply Last reply
                    0
                    • julian@community.nodebb.orgJ julian@community.nodebb.org

                      @rimu@mastodon.nzoss.nz said in Slightly better titles from fediverse topics:

                      I like your method of stopping at the first '.', that would yield better results more often.

                      Thanks, it worked decently until I remembered that there were additional punctuation marks besides the lowly period.

                      So I had to add in support for ? and !, and update the logic to actually add those punctuation marks back in to the title.

                      ... and yet there are more edge cases... some bot accounts post a title-esque first line along with a link, which needs to be teased out.

                      rimu@mastodon.nzoss.nzR This user is from outside of this forum
                      rimu@mastodon.nzoss.nzR This user is from outside of this forum
                      rimu@mastodon.nzoss.nz
                      wrote on last edited by
                      #10

                      @julian Ooo good point about adding the ? back on.

                      If you're interested in a non-regex solution, here's what I have - https://codeberg.org/rimu/pyfedi/src/branch/main/app/utils.py#L247

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Login or register to search.
                      Powered by NodeBB Contributors
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Popular